Index: base/logging.h |
diff --git a/base/logging.h b/base/logging.h |
index a78b7864c9705647fe56884a8a51c7acdf5b2554..e95bd3b5db8eb02c823d1191cbc6299839858b60 100644 |
--- a/base/logging.h |
+++ b/base/logging.h |
@@ -238,6 +238,9 @@ BASE_EXPORT void SetMinLogLevel(int level); |
// Gets the current log level. |
BASE_EXPORT int GetMinLogLevel(); |
+// Used by LOG_IS_ON to lazy-evaluate stream arguments. |
+BASE_EXPORT bool ShouldCreateLogMessage(int severity); |
+ |
// Gets the VLOG default verbosity level. |
BASE_EXPORT int GetVlogVerbosity(); |
@@ -340,7 +343,7 @@ const LogSeverity LOG_0 = LOG_ERROR; |
// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will |
// always fire if they fail. |
#define LOG_IS_ON(severity) \ |
- ((::logging::LOG_ ## severity) >= ::logging::GetMinLogLevel()) |
+ (::logging::ShouldCreateLogMessage(::logging::LOG_##severity)) |
// We can't do any caching tricks with VLOG_IS_ON() like the |
// google-glog version since it requires GCC extensions. This means |