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

Unified Diff: base/logging.cc

Issue 1499693002: Don't evaluate args to LOG(INFO) and LOG(WARNING) in release builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « base/logging.h ('k') | base/logging_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/logging.cc
diff --git a/base/logging.cc b/base/logging.cc
index 650351d837e39fefdb9223c757840bcc18cd7cb4..2aedbef44752ac89b3fb5a76f071b8af15fe9784 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -390,6 +390,15 @@ int GetMinLogLevel() {
return g_min_log_level;
}
+bool ShouldCreateLogMessage(int severity) {
+ if (severity < g_min_log_level)
+ return false;
+
+ // These are the cases for which ~LogMessage does something.
+ return g_logging_destination != LOG_NONE || log_message_handler ||
+ severity >= kAlwaysPrintErrorLevel;
brettw 2015/12/03 23:52:14 Do ew need the kAlwaysPrintErrorLevel check here?
skobes 2015/12/03 23:57:26 Yeah, ~LogMessage writes to stderr if severity_ >=
+}
+
int GetVlogVerbosity() {
return std::max(-1, LOG_INFO - GetMinLogLevel());
}
« no previous file with comments | « base/logging.h ('k') | base/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698