Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Unified Diff: base/logging.h

Issue 1609563002: Remove logging::LogAtLevel and rewrite its sole caller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dbus/object_proxy.cc » ('j') | dbus/object_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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".
« no previous file with comments | « no previous file | dbus/object_proxy.cc » ('j') | dbus/object_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698