Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::Logger Class Referencefinal

A simple thread-safe logger for the channel specified in the constructor. More...

#include <Logger.hpp>

Public Member Functions

 Logger (std::string channel)
 Construct a new Logger object that produces loglines for the specified channel.
 
 Logger (Logger const &)=default
 
 Logger (Logger &&)=default
 
Loggeroperator= (Logger const &)=default
 
Loggeroperator= (Logger &&)=default
 
Pump trace (SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
 Interface for logging at Severity::TRC severity.
 
Pump debug (SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
 Interface for logging at Severity::DBG severity.
 
Pump info (SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
 Interface for logging at Severity::NFO severity.
 
Pump warn (SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
 Interface for logging at Severity::WRN severity.
 
Pump error (SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
 Interface for logging at Severity::ERR severity.
 
Pump fatal (SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
 Interface for logging at Severity::FTL severity.
 

Static Public Attributes

static constexpr std::array< char const *, 8 > kCHANNELS
 

Friends

class LogService
 

Detailed Description

A simple thread-safe logger for the channel specified in the constructor.

This is cheap to copy and move. Designed to be used as a member variable or otherwise. See LogService::init() for setup of the logging core and severity levels for each channel.

Constructor & Destructor Documentation

◆ Logger()

util::Logger::Logger ( std::string channel)
inline

Construct a new Logger object that produces loglines for the specified channel.

See LogService::init() for general setup and configuration of severity levels per channel.

Parameters
channelThe channel this logger will report into.

Member Function Documentation

◆ debug()

Logger::Pump util::Logger::debug ( SourceLocationType const & loc = CURRENT_SRC_LOCATION) const
nodiscard

Interface for logging at Severity::DBG severity.

Parameters
locThe source location of the log message
Returns
The pump to use for logging

◆ error()

Logger::Pump util::Logger::error ( SourceLocationType const & loc = CURRENT_SRC_LOCATION) const
nodiscard

Interface for logging at Severity::ERR severity.

Parameters
locThe source location of the log message
Returns
The pump to use for logging

◆ fatal()

Logger::Pump util::Logger::fatal ( SourceLocationType const & loc = CURRENT_SRC_LOCATION) const
nodiscard

Interface for logging at Severity::FTL severity.

Parameters
locThe source location of the log message
Returns
The pump to use for logging

◆ info()

Logger::Pump util::Logger::info ( SourceLocationType const & loc = CURRENT_SRC_LOCATION) const
nodiscard

Interface for logging at Severity::NFO severity.

Parameters
locThe source location of the log message
Returns
The pump to use for logging

◆ trace()

Logger::Pump util::Logger::trace ( SourceLocationType const & loc = CURRENT_SRC_LOCATION) const
nodiscard

Interface for logging at Severity::TRC severity.

Parameters
locThe source location of the log message
Returns
The pump to use for logging

◆ warn()

Logger::Pump util::Logger::warn ( SourceLocationType const & loc = CURRENT_SRC_LOCATION) const
nodiscard

Interface for logging at Severity::WRN severity.

Parameters
locThe source location of the log message
Returns
The pump to use for logging

Member Data Documentation

◆ kCHANNELS

std::array<char const*, 8> util::Logger::kCHANNELS
staticconstexpr
Initial value:
= {
"General",
"WebServer",
"Backend",
"RPC",
"ETL",
"Subscriptions",
"Performance",
"Migration",
}

The documentation for this class was generated from the following files: