Changes imported from Abseil "staging" branch:
- 93fb81f991e9079769aa28381426f318a1c64377 Add an iterable container of valid absl::LogSeverity valu... by Abseil Team <absl-team@google.com> GitOrigin-RevId: 93fb81f991e9079769aa28381426f318a1c64377 Change-Id: I63d2c6fe6865f5f92a2260368c58585bc994b5e4
This commit is contained in:
parent
f4f238b09b
commit
8a401394b8
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
||||||
#ifndef ABSL_BASE_INTERNAL_LOG_SEVERITY_H_
|
#ifndef ABSL_BASE_INTERNAL_LOG_SEVERITY_H_
|
||||||
#define ABSL_BASE_INTERNAL_LOG_SEVERITY_H_
|
#define ABSL_BASE_INTERNAL_LOG_SEVERITY_H_
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
|
||||||
#include "absl/base/attributes.h"
|
#include "absl/base/attributes.h"
|
||||||
|
|
||||||
namespace absl {
|
namespace absl {
|
||||||
|
@ -27,6 +29,13 @@ enum class LogSeverity : int {
|
||||||
kFatal = 3,
|
kFatal = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Returns an iterable of all standard `absl::LogSeverity` values, ordered from
|
||||||
|
// least to most severe.
|
||||||
|
constexpr std::array<absl::LogSeverity, 4> LogSeverities() {
|
||||||
|
return {{absl::LogSeverity::kInfo, absl::LogSeverity::kWarning,
|
||||||
|
absl::LogSeverity::kError, absl::LogSeverity::kFatal}};
|
||||||
|
}
|
||||||
|
|
||||||
constexpr const char* LogSeverityName(absl::LogSeverity s) {
|
constexpr const char* LogSeverityName(absl::LogSeverity s) {
|
||||||
return s == absl::LogSeverity::kInfo
|
return s == absl::LogSeverity::kInfo
|
||||||
? "INFO"
|
? "INFO"
|
||||||
|
|
Loading…
Reference in a new issue