diff options
author | Abseil Team <absl-team@google.com> | 2021-12-20 08:44:32 -0800 |
---|---|---|
committer | Gennadiy Rozental <rogeeff@google.com> | 2021-12-20 19:17:38 +0000 |
commit | f523d0dd69806d8057a898bb2595910558156aaa (patch) | |
tree | d9d11b6417c37ad1e83627e89010c2b7fed51a67 /absl/base/log_severity.cc | |
parent | 52d41a9ec23e39db7e2cbce5c9449506cf2d3a5c (diff) |
Export of internal Abseil changes
--
1e25fb5996193524bf2f75781f1e6bdcdf972a3a by Gennadiy Rozental <rogeeff@google.com>:
Introduce enums to represent lower and upper thresholds for LogSeverity.
PiperOrigin-RevId: 417414673
--
abfddb3a6ad8ce4849fbb6dadb34d7d6295def0f by Abseil Team <absl-team@google.com>:
Restore __arch64__ macro check for SPARC
PiperOrigin-RevId: 416798208
PiperOrigin-RevId: 416688543
GitOrigin-RevId: 1e25fb5996193524bf2f75781f1e6bdcdf972a3a
Change-Id: I424dd98e5e07420d5f9dfd191f2bfc06036e2bd1
Diffstat (limited to 'absl/base/log_severity.cc')
-rw-r--r-- | absl/base/log_severity.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/absl/base/log_severity.cc b/absl/base/log_severity.cc index 72312afd..de26b06e 100644 --- a/absl/base/log_severity.cc +++ b/absl/base/log_severity.cc @@ -23,5 +23,31 @@ std::ostream& operator<<(std::ostream& os, absl::LogSeverity s) { if (s == absl::NormalizeLogSeverity(s)) return os << absl::LogSeverityName(s); return os << "absl::LogSeverity(" << static_cast<int>(s) << ")"; } + +std::ostream& operator<<(std::ostream& os, absl::LogSeverityAtLeast s) { + switch (s) { + case absl::LogSeverityAtLeast::kInfo: + case absl::LogSeverityAtLeast::kWarning: + case absl::LogSeverityAtLeast::kError: + case absl::LogSeverityAtLeast::kFatal: + return os << ">=" << static_cast<absl::LogSeverity>(s); + case absl::LogSeverityAtLeast::kInfinity: + return os << "INFINITY"; + } + return os; +} + +std::ostream& operator<<(std::ostream& os, absl::LogSeverityAtMost s) { + switch (s) { + case absl::LogSeverityAtMost::kInfo: + case absl::LogSeverityAtMost::kWarning: + case absl::LogSeverityAtMost::kError: + case absl::LogSeverityAtMost::kFatal: + return os << "<=" << static_cast<absl::LogSeverity>(s); + case absl::LogSeverityAtMost::kNegativeInfinity: + return os << "NEGATIVE_INFINITY"; + } + return os; +} ABSL_NAMESPACE_END } // namespace absl |