Changeset View
Changeset View
Standalone View
Standalone View
src/logging.cpp
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | for (const CLogCategoryDesc &category_desc : LogCategories) { | ||||
if (category_desc.category == str) { | if (category_desc.category == str) { | ||||
flag = category_desc.flag; | flag = category_desc.flag; | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
std::string ListLogCategories() { | std::vector<LogCategory> BCLog::Logger::LogCategoriesList() { | ||||
std::string ret; | std::vector<LogCategory> ret; | ||||
int outcount = 0; | |||||
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) { | for (const CLogCategoryDesc &category_desc : LogCategories) { | ||||
// Omit the special cases. | // Omit the special cases. | ||||
if (category_desc.flag != BCLog::NONE && | if (category_desc.flag != BCLog::NONE && | ||||
category_desc.flag != BCLog::ALL) { | category_desc.flag != BCLog::ALL) { | ||||
CLogCategoryActive catActive; | LogCategory catActive; | ||||
catActive.category = category_desc.category; | catActive.category = category_desc.category; | ||||
catActive.active = LogAcceptCategory(category_desc.flag); | catActive.active = WillLogCategory(category_desc.flag); | ||||
ret.push_back(catActive); | ret.push_back(catActive); | ||||
} | } | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
BCLog::Logger::~Logger() { | BCLog::Logger::~Logger() { | ||||
if (m_fileout) { | if (m_fileout) { | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |