mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Add BCLog::Logger::m_log_level data member and getter/setter
Co-authored-by: "klementtan <klementtan@gmail.com>"
This commit is contained in:
parent
f1379aeca9
commit
2978b387bf
1 changed files with 8 additions and 0 deletions
|
@ -74,6 +74,7 @@ namespace BCLog {
|
|||
Error,
|
||||
None, // Internal use only
|
||||
};
|
||||
constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
|
||||
|
||||
class Logger
|
||||
{
|
||||
|
@ -91,6 +92,10 @@ namespace BCLog {
|
|||
*/
|
||||
std::atomic_bool m_started_new_line{true};
|
||||
|
||||
//! If there is no category-specific log level, all logs with a severity
|
||||
//! level lower than `m_log_level` will be ignored.
|
||||
std::atomic<Level> m_log_level{DEFAULT_LOG_LEVEL};
|
||||
|
||||
/** Log categories bitfield. */
|
||||
std::atomic<uint32_t> m_categories{0};
|
||||
|
||||
|
@ -143,6 +148,9 @@ namespace BCLog {
|
|||
|
||||
void ShrinkDebugFile();
|
||||
|
||||
Level LogLevel() const { return m_log_level.load(); }
|
||||
void SetLogLevel(Level level) { m_log_level = level; }
|
||||
|
||||
uint32_t GetCategoryMask() const { return m_categories.load(); }
|
||||
|
||||
void EnableCategory(LogFlags flag);
|
||||
|
|
Loading…
Add table
Reference in a new issue