aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/third_party/abseil-cpp/absl/base/log_severity.h
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/third_party/abseil-cpp/absl/base/log_severity.h')
-rw-r--r--Firestore/third_party/abseil-cpp/absl/base/log_severity.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Firestore/third_party/abseil-cpp/absl/base/log_severity.h b/Firestore/third_party/abseil-cpp/absl/base/log_severity.h
index e146bcb..e2931c3 100644
--- a/Firestore/third_party/abseil-cpp/absl/base/log_severity.h
+++ b/Firestore/third_party/abseil-cpp/absl/base/log_severity.h
@@ -22,6 +22,9 @@
namespace absl {
+// Four severity levels are defined. Logging APIs should terminate the program
+// when a message is logged at severity `kFatal`; the other levels have no
+// special semantics.
enum class LogSeverity : int {
kInfo = 0,
kWarning = 1,
@@ -36,6 +39,8 @@ constexpr std::array<absl::LogSeverity, 4> LogSeverities() {
absl::LogSeverity::kError, absl::LogSeverity::kFatal}};
}
+// Returns the all-caps std::string representation (e.g. "INFO") of the specified
+// severity level if it is one of the normal levels and "UNKNOWN" otherwise.
constexpr const char* LogSeverityName(absl::LogSeverity s) {
return s == absl::LogSeverity::kInfo
? "INFO"
@@ -46,7 +51,8 @@ constexpr const char* LogSeverityName(absl::LogSeverity s) {
: s == absl::LogSeverity::kFatal ? "FATAL" : "UNKNOWN";
}
-// Note that out-of-range severities normalize to kInfo or kError, never kFatal.
+// Values less than `kInfo` normalize to `kInfo`; values greater than `kFatal`
+// normalize to `kError` (**NOT** `kFatal`).
constexpr absl::LogSeverity NormalizeLogSeverity(absl::LogSeverity s) {
return s < absl::LogSeverity::kInfo
? absl::LogSeverity::kInfo