mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
log: Use Join() helper when listing log categories
This commit is contained in:
parent
79b0459648
commit
faec063887
4 changed files with 17 additions and 31 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue