Manages all log domains. More...

#include <log_manager.hpp>

Inherits matador::singleton< log_manager >.

Public Member Functions

logger create_logger (std::string source)
 
logger create_logger (std::string source, const std::string &domain_name)
 
void add_sink (sink_ptr sink)
 
void add_sink (sink_ptr sink, const std::string &domain_name)
 
void clear_all_sinks ()
 
void clear_all_sinks (const std::string &domain_name)
 
void clear ()
 

Static Public Member Functions

static void max_default_log_level (log_level max_level)
 
static log_level max_default_log_level ()
 
static void min_default_log_level (log_level min_level)
 
static log_level min_default_log_level ()
 
- Static Public Member Functions inherited from matador::singleton< log_manager >
static value_typeinstance ()
 Access the instance of the class.
 

Friends

class singleton< log_manager >
 

Additional Inherited Members

- Public Types inherited from matador::singleton< log_manager >
typedef log_manager value_type
 

Detailed Description

Manages all log domains.

The log_manager class is a singleton and manages all available log_domains

There ist always a default log domain with the name "default" available for which sinks can be added and loggers can be created.

Member Function Documentation

◆ add_sink() [1/2]

void matador::log_manager::add_sink ( sink_ptr  sink)

Adds a log sink to the default log_domain

Parameters
sinkSink to add to the default log_domain

◆ add_sink() [2/2]

void matador::log_manager::add_sink ( sink_ptr  sink,
const std::string &  domain_name 
)

Adds a log sink to the log_domain with the given name. If the log domain doesn't exists, it is automatically created.

Parameters
sinkSink to add
domain_nameName of the log domain

◆ clear()

void matador::log_manager::clear ( )

Remove all log domains but the default log domain. Clears all sinks from the default log domain.

◆ clear_all_sinks() [1/2]

void matador::log_manager::clear_all_sinks ( )

Clears all sinks from default log domain

◆ clear_all_sinks() [2/2]

void matador::log_manager::clear_all_sinks ( const std::string &  domain_name)

Clears all sinks from the log domain with the given name

Parameters
domain_nameDomain name to clear all sinks from

◆ create_logger() [1/2]

logger matador::log_manager::create_logger ( std::string  source)

Creates a logger with the given source name for the default log domain

Parameters
sourceName of the source
Returns
The created logger

◆ create_logger() [2/2]

logger matador::log_manager::create_logger ( std::string  source,
const std::string &  domain_name 
)

Creates a logger with the given source name for the log domain identified by the given log domain name.

If the log domain with the given name doesn't exists the domain ist created

Parameters
sourceName of the source
domain_nameThe name of the log domain to execute to
Returns
The created logger

◆ max_default_log_level() [1/2]

static log_level matador::log_manager::max_default_log_level ( )
static

Returns the default max log level

Returns
The max log level

◆ max_default_log_level() [2/2]

static void matador::log_manager::max_default_log_level ( log_level  max_level)
static

Sets the max default log level. Default max leven is LVL_FATAL. All log domains will start with this default max log range

Parameters
max_levelmax log level

◆ min_default_log_level() [1/2]

static log_level matador::log_manager::min_default_log_level ( )
static

Returns the default min log level

Returns
The min log level

◆ min_default_log_level() [2/2]

static void matador::log_manager::min_default_log_level ( log_level  min_level)
static

Sets the default min log level. Default min leven is LVL_INFO. All log domains will start with this default max log range

Parameters
min_levelmin log level

The documentation for this class was generated from the following file:
  • matador/logger/log_manager.hpp