userver: userver/logging/level.hpp File Reference
Loading...
Searching...
No Matches
level.hpp File Reference

Detailed Description

Log levels.

Definition in file level.hpp.

Go to the source code of this file.

#include <cstdint>
#include <optional>
#include <string>
+ Include dependency graph for level.hpp:
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  logging
 Logging macro and utilities.
 

Enumerations

enum class  logging::Level : std::uint8_t {
  kTrace = 0 ,
  kDebug = 1 ,
  kInfo = 2 ,
  kWarning = 3 ,
  kError = 4 ,
  kCritical = 5 ,
  kNone = 6
}
 Log levels. More...
 

Functions

Level logging::LevelFromString (std::string_view)
 Converts lowercase level name to a corresponding Level, throws std::runtime_error if no matching log level found.
 
std::string_view logging::ToString (Level level)
 Returns a string representation of logging level, e.g. "info".
 
std::string_view logging::ToUpperCaseString (Level level) noexcept
 Returns a string representation of logging level, e.g. "INFO".
 
std::optional< Levellogging::OptionalLevelFromString (const std::optional< std::string > &level_name)
 Returns std::nullopt if level_name is std::nullopt, otherwise behaves exactly like logging::LevelFromString.
 

Variables

constexpr auto logging::kLevelMax = static_cast<int>(Level::kNone)