| 275 | } |
| 276 | |
| 277 | std::vector<LogCategory> BCLog::Logger::LogCategoriesList() const |
| 278 | { |
| 279 | // Sort log categories by alphabetical order. |
| 280 | std::array<CLogCategoryDesc, std::size(LogCategories)> categories; |
| 281 | std::copy(std::begin(LogCategories), std::end(LogCategories), categories.begin()); |
| 282 | std::sort(categories.begin(), categories.end(), [](auto a, auto b) { return a.category < b.category; }); |
| 283 | |
| 284 | std::vector<LogCategory> ret; |
| 285 | for (const CLogCategoryDesc& category_desc : categories) { |
| 286 | if (category_desc.flag == BCLog::NONE || category_desc.flag == BCLog::ALL) continue; |
| 287 | LogCategory catActive; |
| 288 | catActive.category = category_desc.category; |
| 289 | catActive.active = WillLogCategory(category_desc.flag); |
| 290 | ret.push_back(catActive); |
| 291 | } |
| 292 | return ret; |
| 293 | } |
| 294 | |
| 295 | std::string BCLog::Logger::LogTimestampStr(const std::string& str) |
| 296 | { |