Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::LogService Class Reference

A global logging service. More...

#include <Logger.hpp>

Inheritance diagram for util::LogService:
Collaboration diagram for util::LogService:

Static Public Member Functions

static std::expected< void, std::string > init (config::ClioConfigDefinition const &config)
 Global log core initialization from a config::ClioConfigDefinition.
static void shutdown ()
 Shutdown spdlog to guarantee output is not lost.
static Logger::Pump trace (SourceLocationType const &loc=CURRENT_SRC_LOCATION)
 Globally accessible General logger at Severity::TRC severity.
static Logger::Pump debug (SourceLocationType const &loc=CURRENT_SRC_LOCATION)
 Globally accessible General logger at Severity::DBG severity.
static Logger::Pump info (SourceLocationType const &loc=CURRENT_SRC_LOCATION)
 Globally accessible General logger at Severity::NFO severity.
static Logger::Pump warn (SourceLocationType const &loc=CURRENT_SRC_LOCATION)
 Globally accessible General logger at Severity::WRN severity.
static Logger::Pump error (SourceLocationType const &loc=CURRENT_SRC_LOCATION)
 Globally accessible General logger at Severity::ERR severity.
static Logger::Pump fatal (SourceLocationType const &loc=CURRENT_SRC_LOCATION)
 Globally accessible General logger at Severity::FTL severity.

Friends

struct ::BenchmarkLoggingInitializer

Additional Inherited Members

Static Protected Member Functions inherited from util::LogServiceState
static void init (bool isAsync, Severity defaultSeverity, std::vector< std::shared_ptr< spdlog::sinks::sink > > const &sinks)
 Initialize the logging core with specified parameters.
static bool initialized ()
 Whether the LogService is initialized or not.
static void reset ()
 Reset the logging service to uninitialized state.
static void replaceSinks (std::vector< std::shared_ptr< spdlog::sinks::sink > > const &sinks)
 Replace the current sinks with a new set of sinks.
static std::shared_ptr< spdlog::logger > registerLogger (std::string const &channel, std::optional< Severity > severity=std::nullopt)
 Register a new logger for the specified channel.
Static Protected Attributes inherited from util::LogServiceState
static bool isAsync_ {true}
static Severity defaultSeverity_ {Severity::NFO}
static std::vector< std::shared_ptr< spdlog::sinks::sink > > sinks_ {}
static bool initialized_ {false}

Detailed Description

A global logging service.

Used to initialize and setup the logging core as well as a globally available entrypoint for logging into the General channel as well as raising alerts.

Member Function Documentation

◆ debug()

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

Globally accessible General logger at Severity::DBG severity.

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

◆ error()

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

Globally accessible General logger at Severity::ERR severity.

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

◆ fatal()

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

Globally accessible General logger at Severity::FTL severity.

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

◆ info()

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

Globally accessible General logger at Severity::NFO severity.

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

◆ init()

std::expected< void, std::string > util::LogService::init ( config::ClioConfigDefinition const & config)
staticnodiscard

Global log core initialization from a config::ClioConfigDefinition.

Parameters
configThe configuration to use
Returns
Void on success, error message on failure

◆ trace()

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

Globally accessible General logger at Severity::TRC severity.

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

◆ warn()

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

Globally accessible General logger at Severity::WRN severity.

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

The documentation for this class was generated from the following files:
  • /__w/clio/clio/src/util/log/Logger.hpp
  • /__w/clio/clio/src/util/log/Logger.cpp