mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01: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,
|
Error,
|
||||||
None, // Internal use only
|
None, // Internal use only
|
||||||
};
|
};
|
||||||
|
constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
|
||||||
|
|
||||||
class Logger
|
class Logger
|
||||||
{
|
{
|
||||||
|
@ -91,6 +92,10 @@ namespace BCLog {
|
||||||
*/
|
*/
|
||||||
std::atomic_bool m_started_new_line{true};
|
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. */
|
/** Log categories bitfield. */
|
||||||
std::atomic<uint32_t> m_categories{0};
|
std::atomic<uint32_t> m_categories{0};
|
||||||
|
|
||||||
|
@ -143,6 +148,9 @@ namespace BCLog {
|
||||||
|
|
||||||
void ShrinkDebugFile();
|
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(); }
|
uint32_t GetCategoryMask() const { return m_categories.load(); }
|
||||||
|
|
||||||
void EnableCategory(LogFlags flag);
|
void EnableCategory(LogFlags flag);
|
||||||
|
|
Loading…
Add table
Reference in a new issue