iceberg-cpp
Loading...
Searching...
No Matches
Enumerations | Functions
log_level.h File Reference

Severity levels for the logging system. More...

#include <string_view>
#include <utility>
#include "iceberg/result.h"
#include "iceberg/util/string_util.h"

Go to the source code of this file.

Enumerations

enum class  iceberg::LogLevel {
  kTrace , kDebug , kInfo , kWarn ,
  kError , kCritical , kFatal , kOff
}
 Logging severity level, ordered from most to least verbose. More...
 

Functions

constexpr std::string_view iceberg::ToString (LogLevel level) noexcept
 String representation of a LogLevel.
 
Result< LogLeveliceberg::LogLevelFromString (std::string_view s)
 Parse a LogLevel from a string (case-insensitive).
 

Detailed Description

Severity levels for the logging system.

Enumeration Type Documentation

◆ LogLevel

enum class iceberg::LogLevel
strong

Logging severity level, ordered from most to least verbose.

Levels are ordered so that level >= threshold is the enabled test. kOff is the maximum sentinel: as a threshold it disables all emission (it is never the level of an actual message).

Function Documentation

◆ LogLevelFromString()

Result< LogLevel > iceberg::LogLevelFromString ( std::string_view  s)
inline

Parse a LogLevel from a string (case-insensitive).

Parameters
sThe string to parse ("trace", "debug", "info", "warn", "error", "critical", "fatal", or "off").
Returns
The LogLevel, or an InvalidArgument error if unrecognized.