Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,487 Lines • ▼ Show 20 Lines | bool AppInitParameterInteraction(Config &config) { | ||||
// 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 (find(categories.begin(), categories.end(), std::string("0")) == | ||||
categories.end()) { | categories.end()) { | ||||
for (const auto &cat : categories) { | for (const auto &cat : categories) { | ||||
BCLog::LogFlags flag; | 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; | |||||
} | } | ||||
GetLogger().EnableCategory(flag); | GetLogger().EnableCategory(flag); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// Now remove the logging categories which were explicitly excluded | // Now remove the logging categories which were explicitly excluded | ||||
for (const std::string &cat : gArgs.GetArgs("-debugexclude")) { | for (const std::string &cat : gArgs.GetArgs("-debugexclude")) { | ||||
BCLog::LogFlags flag; | BCLog::LogFlags flag = BCLog::NONE; | ||||
if (!GetLogCategory(flag, cat)) { | if (!GetLogCategory(flag, cat)) { | ||||
InitWarning(strprintf(_("Unsupported logging category %s=%s."), | InitWarning(strprintf(_("Unsupported logging category %s=%s."), | ||||
"-debugexclude", cat)); | "-debugexclude", cat)); | ||||
continue; | |||||
} | } | ||||
GetLogger().DisableCategory(flag); | GetLogger().DisableCategory(flag); | ||||
} | } | ||||
// Check for -debugnet | // Check for -debugnet | ||||
if (gArgs.GetBoolArg("-debugnet", false)) { | if (gArgs.GetBoolArg("-debugnet", false)) { | ||||
InitWarning( | InitWarning( | ||||
_("Unsupported argument -debugnet ignored, use -debug=net.")); | _("Unsupported argument -debugnet ignored, use -debug=net.")); | ||||
▲ Show 20 Lines • Show All 942 Lines • Show Last 20 Lines |