Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(577)

Unified Diff: src/processor/logging.h

Issue 724002: Add support for configuring the minimum log level at compile time Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/processor/logging.h
===================================================================
--- src/processor/logging.h (revision 1229)
+++ src/processor/logging.h (working copy)
@@ -146,8 +146,20 @@
#define BPLOG_INIT(pargc, pargv)
#endif // BPLOG_INIT
+#define BPLOG_LAZY_STREAM(stream, condition) \
+ !(condition) ? (void) 0 : \
+ google_breakpad::LogMessageVoidify() & (BPLOG_ ## stream)
+
+#ifndef BPLOG_MINIMUM_SEVERITY
+#define BPLOG_MINIMUM_SEVERITY SEVERITY_INFO
+#endif
+
+#define BPLOG_LOG_IS_ON(severity) \
+ ((google_breakpad::LogStream::SEVERITY_ ## severity) >= \
+ (google_breakpad::LogStream::BPLOG_MINIMUM_SEVERITY))
+
#ifndef BPLOG
-#define BPLOG(severity) BPLOG_ ## severity
+#define BPLOG(severity) BPLOG_LAZY_STREAM(severity, BPLOG_LOG_IS_ON(severity))
#endif // BPLOG
#ifndef BPLOG_INFO
@@ -169,7 +181,6 @@
#endif // BPLOG_ERROR
#define BPLOG_IF(severity, condition) \
- !(condition) ? (void) 0 : \
- google_breakpad::LogMessageVoidify() & BPLOG(severity)
+ BPLOG_LAZY_STREAM(severity, ((condition) && BPLOG_LOG_IS_ON(severity)))
#endif // PROCESSOR_LOGGING_H__
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted