diff options
author | Jim Posen <jimpo@coinbase.com> | 2018-04-11 14:06:35 -0700 |
---|---|---|
committer | Jim Posen <jimpo@coinbase.com> | 2018-04-29 14:37:17 -0700 |
commit | 1eac317f25b905e97e311130ab19c3b0d257fc04 (patch) | |
tree | cf844c12f7b18d452492200dab948d6ba9d40028 /src/init.cpp | |
parent | 3316a9ebb66171937efddb213daed64fe51c4082 (diff) |
util: Refactor GetLogCategory.
Changing parameter types from pointers to references and uint32_t to
BCLog::LogFlags simplies calling code.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/init.cpp b/src/init.cpp index ccaa09a85e..c0eb746d7b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -963,24 +963,18 @@ bool AppInitParameterInteraction() if (std::none_of(categories.begin(), categories.end(), [](std::string cat){return cat == "0" || cat == "none";})) { for (const auto& cat : categories) { - uint32_t flag = 0; - if (!GetLogCategory(&flag, &cat)) { + if (!g_logger->EnableCategory(cat)) { InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat)); - continue; } - g_logger->EnableCategory(static_cast<BCLog::LogFlags>(flag)); } } } // Now remove the logging categories which were explicitly excluded for (const std::string& cat : gArgs.GetArgs("-debugexclude")) { - uint32_t flag = 0; - if (!GetLogCategory(&flag, &cat)) { + if (!g_logger->DisableCategory(cat)) { InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat)); - continue; } - g_logger->DisableCategory(static_cast<BCLog::LogFlags>(flag)); } // Check for -debugnet |