olp-cpp-sdk  1.22.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
olp::logging::Configuration Class Reference

Configures appenders and loggers available in the logging system. More...

#include <Configuration.h>

Classes

struct  AppenderWithLogLevel
 Contains an appender and its log level. More...
 

Public Types

using AppenderList = std::vector< AppenderWithLogLevel >
 A typedef for a list of appenders.
 

Public Member Functions

bool isValid () const
 Checks whether the configuration is valid. More...
 
ConfigurationaddAppender (std::shared_ptr< IAppender > appender, logging::Level level=logging::Level::Trace)
 Adds the appender along with its log level to the configuration. More...
 
Configurationclear ()
 Clears the list of appenders.
 
const AppenderListgetAppenders () const
 Gets the appenders from the configuration. More...
 

Static Public Member Functions

static Configuration createDefault ()
 Creates a default configuration by adding an instance of DebugAppender and ConsoleAppender as appenders. More...
 

Detailed Description

Configures appenders and loggers available in the logging system.

Member Function Documentation

◆ addAppender()

Configuration & olp::logging::Configuration::addAppender ( std::shared_ptr< IAppender appender,
logging::Level  level = logging::Level::Trace 
)
inline

Adds the appender along with its log level to the configuration.

Parameters
appenderThe appender to add.
levelThe log level of the appender.

◆ createDefault()

static Configuration olp::logging::Configuration::createDefault ( )
static

Creates a default configuration by adding an instance of DebugAppender and ConsoleAppender as appenders.

Returns
The default configuration.

◆ getAppenders()

auto olp::logging::Configuration::getAppenders ( ) const
inline

Gets the appenders from the configuration.

Returns
The appenders and their log levels.

◆ isValid()

bool olp::logging::Configuration::isValid ( ) const
inline

Checks whether the configuration is valid.

Returns
True if the configuration is valid; false otherwise.

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