Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,522 Lines • ▼ Show 20 Lines | if (nMaxConnections < nUserMaxConnections) { | ||||
nUserMaxConnections, nMaxConnections)); | nUserMaxConnections, nMaxConnections)); | ||||
} | } | ||||
// Step 3: parameter-to-internal-flags | // Step 3: parameter-to-internal-flags | ||||
if (gArgs.IsArgSet("-debug")) { | if (gArgs.IsArgSet("-debug")) { | ||||
// Special-case: if -debug=0/-nodebug is set, turn off debugging | // Special-case: if -debug=0/-nodebug is set, turn off debugging | ||||
// messages | // messages | ||||
const std::vector<std::string> &categories = gArgs.GetArgs("-debug"); | const std::vector<std::string> &categories = gArgs.GetArgs("-debug"); | ||||
if (find(categories.begin(), categories.end(), std::string("0")) == | if (std::none_of( | ||||
categories.end()) { | categories.begin(), categories.end(), | ||||
[](std::string cat) { return cat == "0" || cat == "none"; })) { | |||||
for (const auto &cat : categories) { | for (const auto &cat : categories) { | ||||
BCLog::LogFlags flag = BCLog::NONE; | BCLog::LogFlags flag = BCLog::NONE; | ||||
if (!GetLogCategory(flag, cat)) { | if (!GetLogCategory(flag, cat)) { | ||||
InitWarning( | InitWarning( | ||||
strprintf(_("Unsupported logging category %s=%s."), | strprintf(_("Unsupported logging category %s=%s."), | ||||
"-debug", cat)); | "-debug", cat)); | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 971 Lines • Show Last 20 Lines |