Index: base/logging.h |
diff --git a/base/logging.h b/base/logging.h |
index 300c9b52694b09068bc051a38494d382cb7350d7..ad8f9f92b8cfd7dd03e7efac9c2f60b22fad0f22 100644 |
--- a/base/logging.h |
+++ b/base/logging.h |
@@ -373,6 +373,12 @@ const LogSeverity LOG_0 = LOG_ERROR; |
#define LOG_IF(severity, condition) \ |
LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) |
+// Like LOG(...), but accepts an expression for the severity value, which may |
+// vary at runtime. |
+#define LOG_AT_LEVEL(severity) \ |
danakj
2016/01/19 21:10:19
I like this better than the method, yah. But I don
|
+ LAZY_STREAM(::logging::LogMessage(__FILE__, __LINE__, (severity)).stream(), \ |
+ ::logging::ShouldCreateLogMessage(severity)) |
+ |
#define SYSLOG(severity) LOG(severity) |
#define SYSLOG_IF(severity, condition) LOG_IF(severity, condition) |
@@ -807,12 +813,6 @@ class BASE_EXPORT LogMessage { |
DISALLOW_COPY_AND_ASSIGN(LogMessage); |
}; |
-// A non-macro interface to the log facility; (useful |
-// when the logging level is not a compile-time constant). |
-inline void LogAtLevel(int log_level, const std::string& msg) { |
- LogMessage(__FILE__, __LINE__, log_level).stream() << msg; |
-} |
- |
// This class is used to explicitly ignore values in the conditional |
// logging macros. This avoids compiler warnings like "value computed |
// is not used" and "statement has no effect". |