diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-01-22 04:22:18 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-01-22 04:22:18 +0000 |
commit | dd7b0034f18fe2adb98d89bc2d4eeaa7dbd099a2 (patch) | |
tree | f7681478921146427edb73e4e70162d18bdfa0b4 /base/include/android-base/logging.h | |
parent | 5e8b40f3bb00ced5da858e373345795c519e74dc (diff) | |
parent | daec2f4f88253e2e6c9ac38c1903e9ef0e1c07fe (diff) |
Snap for 6152176 from daec2f4f88253e2e6c9ac38c1903e9ef0e1c07fe to rvc-release
Change-Id: Icf074761856709508e65f435e25a8f64aeab708d
Diffstat (limited to 'base/include/android-base/logging.h')
-rw-r--r-- | base/include/android-base/logging.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/base/include/android-base/logging.h b/base/include/android-base/logging.h index 3a9186aed..077988e1c 100644 --- a/base/include/android-base/logging.h +++ b/base/include/android-base/logging.h @@ -85,7 +85,7 @@ enum LogSeverity { INFO, WARNING, ERROR, - FATAL_WITHOUT_ABORT, + FATAL_WITHOUT_ABORT, // For loggability tests, this is considered identical to FATAL. FATAL, }; @@ -93,6 +93,8 @@ enum LogId { DEFAULT, MAIN, SYSTEM, + RADIO, + CRASH, }; using LogFunction = std::function<void(LogId, LogSeverity, const char*, const char*, @@ -209,8 +211,8 @@ struct LogAbortAfterFullExpr { #define ABORT_AFTER_LOG_FATAL_EXPR(x) ABORT_AFTER_LOG_EXPR_IF(true, x) // Defines whether the given severity will be logged or silently swallowed. -#define WOULD_LOG(severity) \ - (UNLIKELY((SEVERITY_LAMBDA(severity)) >= ::android::base::GetMinimumLogSeverity()) || \ +#define WOULD_LOG(severity) \ + (UNLIKELY(::android::base::ShouldLog(SEVERITY_LAMBDA(severity), _LOG_TAG_INTERNAL)) || \ MUST_LOG_MESSAGE(severity)) // Get an ostream that can be used for logging at the given severity and to the default @@ -442,6 +444,9 @@ LogSeverity GetMinimumLogSeverity(); // Set the minimum severity level for logging, returning the old severity. LogSeverity SetMinimumLogSeverity(LogSeverity new_severity); +// Return whether or not a log message with the associated tag should be logged. +bool ShouldLog(LogSeverity severity, const char* tag); + // Allows to temporarily change the minimum severity level for logging. class ScopedLogSeverity { public: |