diff options
author | Jim Posen <jimpo@coinbase.com> | 2018-04-11 14:06:35 -0700 |
---|---|---|
committer | Jim Posen <jimpo@coinbase.com> | 2018-04-29 14:37:17 -0700 |
commit | 1eac317f25b905e97e311130ab19c3b0d257fc04 (patch) | |
tree | cf844c12f7b18d452492200dab948d6ba9d40028 /src/logging.h | |
parent | 3316a9ebb66171937efddb213daed64fe51c4082 (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.h | 8 |
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; } |