aboutsummaryrefslogtreecommitdiff
path: root/src/logging.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-16 11:12:14 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-04-16 11:08:46 -0400
commitfaec0638872798b58b9882ee079014555bc8393e (patch)
tree5b38946bd9cde28d4b7844f9409d64b4772ce480 /src/logging.h
parent79b0459648e33307edcefc358d9bfdd0ed5ff844 (diff)
downloadbitcoin-faec0638872798b58b9882ee079014555bc8393e.tar.xz
log: Use Join() helper when listing log categories
Diffstat (limited to 'src/logging.h')
-rw-r--r--src/logging.h17
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);