diff options
author | Max Moroz <mmoroz@chromium.org> | 2018-05-27 14:28:07 -0700 |
---|---|---|
committer | Will Harris <wfh@chromium.org> | 2018-05-29 19:24:32 +0000 |
commit | 27c001192ba9b78fe8f47c5a51a2d0a371860f12 (patch) | |
tree | b8ababbce765697acdde38027f3865d3aa811743 /src | |
parent | Read Linux si_code in minidump_processor. (diff) | |
download | breakpad-27c001192ba9b78fe8f47c5a51a2d0a371860f12.tar.xz |
Add SEVERITY_CRITICAL to logging, that would help to suppress logs from the fuzz target.
Follow-up CL will be https://chromium-review.googlesource.com/c/chromium/src/+/1073395
Bug: 846721
Change-Id: Ie9e6dc5c5ef6b035c414fbdc4f711f995b52f4d7
Reviewed-on: https://chromium-review.googlesource.com/1073394
Reviewed-by: Will Harris <wfh@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/processor/logging.cc | 3 | ||||
-rw-r--r-- | src/processor/logging.h | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/processor/logging.cc b/src/processor/logging.cc index c1eebbc2..d59175a7 100644 --- a/src/processor/logging.cc +++ b/src/processor/logging.cc @@ -69,6 +69,9 @@ LogStream::LogStream(std::ostream &stream, Severity severity, case SEVERITY_ERROR: severity_string = "ERROR"; break; + case SEVERITY_CRITICAL: + severity_string = "CRITICAL"; + break; } stream_ << time_string << ": " << PathnameStripper::File(file) << ":" << diff --git a/src/processor/logging.h b/src/processor/logging.h index 406fb67c..97c2fe31 100644 --- a/src/processor/logging.h +++ b/src/processor/logging.h @@ -94,7 +94,8 @@ class LogStream { public: enum Severity { SEVERITY_INFO, - SEVERITY_ERROR + SEVERITY_ERROR, + SEVERITY_CRITICAL }; // Begin logging a message to the stream identified by |stream|, at the @@ -180,6 +181,15 @@ int ErrnoString(string *error_string); __FILE__, __LINE__) #endif // BPLOG_ERROR +#ifndef BPLOG_CRITICAL +#ifndef BPLOG_CRITICAL_STREAM +#define BPLOG_CRITICAL_STREAM std::cerr +#endif // BPLOG_CRITICAL_STREAM +#define BPLOG_CRITICAL google_breakpad::LogStream(BPLOG_CRITICAL_STREAM, \ + google_breakpad::LogStream::SEVERITY_CRITICAL, \ + __FILE__, __LINE__) +#endif // BPLOG_CRITICAL + #define BPLOG_IF(severity, condition) \ BPLOG_LAZY_STREAM(severity, ((condition) && BPLOG_LOG_IS_ON(severity))) |