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.h | |
parent | 79b0459648e33307edcefc358d9bfdd0ed5ff844 (diff) |
log: Use Join() helper when listing log categories
Diffstat (limited to 'src/logging.h')
-rw-r--r-- | src/logging.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/logging.h b/src/logging.h index b2fde1b9ea..ab07010316 100644 --- a/src/logging.h +++ b/src/logging.h @@ -8,6 +8,7 @@ #include <fs.h> #include <tinyformat.h> +#include <util/string.h> #include <atomic> #include <cstdint> @@ -24,8 +25,7 @@ extern const char * const DEFAULT_DEBUGLOGFILE; extern bool fLogIPs; -struct CLogCategoryActive -{ +struct LogCategory { std::string category; bool active; }; @@ -132,6 +132,13 @@ namespace BCLog { bool DisableCategory(const std::string& str); bool WillLogCategory(LogFlags category) const; + /** Returns a vector of the log categories */ + std::vector<LogCategory> LogCategoriesList(); + /** Returns a string with the log categories */ + std::string LogCategoriesString() + { + return Join(LogCategoriesList(), ", ", [&](const LogCategory& i) { return i.category; }); + }; bool DefaultShrinkDebugFile() const; }; @@ -146,12 +153,6 @@ static inline bool LogAcceptCategory(BCLog::LogFlags category) return LogInstance().WillLogCategory(category); } -/** Returns a string with the log categories. */ -std::string ListLogCategories(); - -/** Returns a vector of the active log categories. */ -std::vector<CLogCategoryActive> ListActiveLogCategories(); - /** Return true if str parses as a log category and set the flag */ bool GetLogCategory(BCLog::LogFlags& flag, const std::string& str); |