diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc index 4ebeebebf7..2b5c80b33c 100644 --- a/rtc_base/logging.cc +++ b/rtc_base/logging.cc @@ -55,13 +55,15 @@ namespace rtc { namespace { // By default, release builds don't log, debug builds at info level #if !defined(NDEBUG) -static LoggingSeverity g_min_sev = LS_INFO; -static LoggingSeverity g_dbg_sev = LS_INFO; +constexpr LoggingSeverity kDefaultLoggingSeverity = LS_INFO; #else -static LoggingSeverity g_min_sev = LS_NONE; -static LoggingSeverity g_dbg_sev = LS_NONE; +constexpr LoggingSeverity kDefaultLoggingSeverity = LS_NONE; #endif +// Note: `g_min_sev` and `g_dbg_sev` can be changed while running. +LoggingSeverity g_min_sev = kDefaultLoggingSeverity; +LoggingSeverity g_dbg_sev = kDefaultLoggingSeverity; + // Return the filename portion of the string (that following the last slash). const char* FilenameFromPath(const char* file) { const char* end1 = ::strrchr(file, '/');