mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
log: Use Join() helper when listing log categories
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user