File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ namespace BCLog {
74
74
Error,
75
75
None, // Internal use only
76
76
};
77
+ constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
77
78
78
79
class Logger
79
80
{
@@ -91,6 +92,10 @@ namespace BCLog {
91
92
*/
92
93
std::atomic_bool m_started_new_line{true };
93
94
95
+ // ! If there is no category-specific log level, all logs with a severity
96
+ // ! level lower than `m_log_level` will be ignored.
97
+ std::atomic<Level> m_log_level{DEFAULT_LOG_LEVEL};
98
+
94
99
/* * Log categories bitfield. */
95
100
std::atomic<uint32_t > m_categories{0 };
96
101
@@ -143,6 +148,9 @@ namespace BCLog {
143
148
144
149
void ShrinkDebugFile ();
145
150
151
+ Level LogLevel () const { return m_log_level.load (); }
152
+ void SetLogLevel (Level level) { m_log_level = level; }
153
+
146
154
uint32_t GetCategoryMask () const { return m_categories.load (); }
147
155
148
156
void EnableCategory (LogFlags flag);
You can’t perform that action at this time.
0 commit comments