OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::logging Namespace Reference

Data Structures

class  log
 Generalized logging class. More...
 
class  null_stream
 No-op stream destination for log output. More...
 

Enumerations

enum class  log_level : uint8_t {
  trace , debug , info , warn ,
  error , fatal
}
 Set of possible log levels. More...
 

Functions

auto parse_loglevel (const std::string &level) -> std::optional< log_level >
 Parses a capitalized string into a log level.
 

Enumeration Type Documentation

◆ log_level

enum class cbdc::logging::log_level : uint8_t
strong

Set of possible log levels.

Used to configure log. Each level implies that the logger should output messages at that level or greater.

Enumerator
trace 

Fine-grained, fully verbose operating information.

debug 

Diagnostic information.

info 

General information about the state of the system.

warn 

Potentially unintended, unexpected, or undesirable behavior.

error 

Serious, critical errors.

fatal 

Only fatal errors.

Definition at line 34 of file logging.hpp.

Function Documentation

◆ parse_loglevel()

auto cbdc::logging::parse_loglevel ( const std::string & level) -> std::optional< log_level >

Parses a capitalized string into a log level.

Possible input values: TRACE, DEBUG, INFO, WARN, ERROR, and FATAL.

Parameters
levelstring corresponding to a log level.
Returns
the log level, or std::nullopt if the input does not correspond to a known log level.

Definition at line 70 of file logging.cpp.

References debug, error, fatal, info, trace, and warn.

Referenced by cbdc::config::parser::get_loglevel(), and cbdc::parsec::read_config().