Add support for configuring the minimum log level at compile time
The minimum log level can be set by defining to macro BPLOG_MINIMUM_SEVERITY to one of google_breakpad::LogStream::Severity values. The default is SEVERITY_INFO. BUG=none R=mark@chromium.org Review URL: https://breakpad.appspot.com/724002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1231 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
		| @@ -146,8 +146,20 @@ int ErrnoString(string *error_string); | |||||||
| #define BPLOG_INIT(pargc, pargv) | #define BPLOG_INIT(pargc, pargv) | ||||||
| #endif  // BPLOG_INIT | #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 | #ifndef BPLOG | ||||||
| #define BPLOG(severity) BPLOG_ ## severity | #define BPLOG(severity) BPLOG_LAZY_STREAM(severity, BPLOG_LOG_IS_ON(severity)) | ||||||
| #endif  // BPLOG | #endif  // BPLOG | ||||||
|  |  | ||||||
| #ifndef BPLOG_INFO | #ifndef BPLOG_INFO | ||||||
| @@ -169,7 +181,6 @@ int ErrnoString(string *error_string); | |||||||
| #endif  // BPLOG_ERROR | #endif  // BPLOG_ERROR | ||||||
|  |  | ||||||
| #define BPLOG_IF(severity, condition) \ | #define BPLOG_IF(severity, condition) \ | ||||||
|     !(condition) ? (void) 0 : \ |     BPLOG_LAZY_STREAM(severity, ((condition) && BPLOG_LOG_IS_ON(severity))) | ||||||
|                    google_breakpad::LogMessageVoidify() & BPLOG(severity) |  | ||||||
|  |  | ||||||
| #endif  // PROCESSOR_LOGGING_H__ | #endif  // PROCESSOR_LOGGING_H__ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 mark@chromium.org
					mark@chromium.org