aboutsummaryrefslogtreecommitdiff
path: root/src/logging.h
diff options
context:
space:
mode:
authorJim Posen <jimpo@coinbase.com>2018-04-11 14:06:35 -0700
committerJim Posen <jimpo@coinbase.com>2018-04-29 14:37:17 -0700
commit1eac317f25b905e97e311130ab19c3b0d257fc04 (patch)
treecf844c12f7b18d452492200dab948d6ba9d40028 /src/logging.h
parent3316a9ebb66171937efddb213daed64fe51c4082 (diff)
util: Refactor GetLogCategory.
Changing parameter types from pointers to references and uint32_t to BCLog::LogFlags simplies calling code.
Diffstat (limited to 'src/logging.h')
-rw-r--r--src/logging.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/logging.h b/src/logging.h
index 7a1c25233a..b88c9d9919 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -95,8 +95,12 @@ namespace BCLog {
void ShrinkDebugFile();
uint32_t GetCategoryMask() const { return logCategories.load(); }
+
void EnableCategory(LogFlags flag);
+ bool EnableCategory(const std::string& str);
void DisableCategory(LogFlags flag);
+ bool DisableCategory(const std::string& str);
+
bool WillLogCategory(LogFlags category) const;
bool DefaultShrinkDebugFile() const;
@@ -118,8 +122,8 @@ 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 flags in f */
-bool GetLogCategory(uint32_t *f, const std::string *str);
+/** Return true if str parses as a log category and set the flag */
+bool GetLogCategory(BCLog::LogFlags& flag, const std::string& str);
/** Get format string from VA_ARGS for error reporting */
template<typename... Args> std::string FormatStringFromLogArgs(const char *fmt, const Args&... args) { return fmt; }