diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-16 11:12:14 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-16 11:08:46 -0400 |
commit | faec0638872798b58b9882ee079014555bc8393e (patch) | |
tree | 5b38946bd9cde28d4b7844f9409d64b4772ce480 /src/logging.cpp | |
parent | 79b0459648e33307edcefc358d9bfdd0ed5ff844 (diff) |
log: Use Join() helper when listing log categories
Diffstat (limited to 'src/logging.cpp')
-rw-r--r-- | src/logging.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index 6fd916b603..eb9da06d9b 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -182,30 +182,15 @@ bool GetLogCategory(BCLog::LogFlags& flag, const std::string& str) return false; } -std::string ListLogCategories() +std::vector<LogCategory> BCLog::Logger::LogCategoriesList() { - std::string ret; - int outcount = 0; + std::vector<LogCategory> ret; for (const CLogCategoryDesc& category_desc : LogCategories) { // Omit the special cases. if (category_desc.flag != BCLog::NONE && category_desc.flag != BCLog::ALL) { - if (outcount != 0) ret += ", "; - ret += category_desc.category; - outcount++; - } - } - return ret; -} - -std::vector<CLogCategoryActive> ListActiveLogCategories() -{ - std::vector<CLogCategoryActive> ret; - for (const CLogCategoryDesc& category_desc : LogCategories) { - // Omit the special cases. - if (category_desc.flag != BCLog::NONE && category_desc.flag != BCLog::ALL) { - CLogCategoryActive catActive; + LogCategory catActive; catActive.category = category_desc.category; - catActive.active = LogAcceptCategory(category_desc.flag); + catActive.active = WillLogCategory(category_desc.flag); ret.push_back(catActive); } } |