matador::logger Class Reference

logger to write log messages to log domains More...

#include <logger.hpp>

Public Member Functions

 logger (std::string source, std::shared_ptr< log_domain > log_domain)
 
 logger (const logger &l)=delete
 
 logger (logger &&l) noexcept
 
loggeroperator= (const logger &l)=delete
 
loggeroperator= (logger &&l) noexcept
 
template<typename ... ARGS>
void fatal (const std::string &what, ARGS const &... args)
 
template<typename ... ARGS>
void fatal (const char *what, ARGS const &... args)
 
template<typename ... ARGS>
void error (const std::string &what, ARGS const &... args)
 
template<typename ... ARGS>
void error (const char *what, ARGS const &... args)
 
template<typename ... ARGS>
void warn (const std::string &what, ARGS const &... args)
 
template<typename ... ARGS>
void warn (const char *what, ARGS const &... args)
 
template<typename ... ARGS>
void info (const std::string &what, ARGS const &... args)
 
template<typename ... ARGS>
void info (const char *what, ARGS const &... args)
 
template<typename ... ARGS>
void debug (const std::string &what, ARGS const &... args)
 
template<typename ... ARGS>
void debug (const char *what, ARGS const &... args)
 
template<typename ... ARGS>
void trace (const std::string &what, ARGS const &... args)
 
template<typename ... ARGS>
void trace (const char *what, ARGS const &... args)
 
template<typename ... ARGS>
void log (log_level lvl, const char *what, ARGS const &... args)
 
void log (log_level lvl, const char *what)
 
const std::string & source () const
 
std::string domain () const
 

Detailed Description

logger to write log messages to log domains

This class is used to write log messages to a connected log domain (

See also
log_domain). Everywhere a logger is needed, it can be instantiated with
const std::string & source() const
OOS_LOGGER_API logger create_logger(std::string source)

The interface provides methods to log to each relevant log level (

See also
log_level)

The message format syntax is like the printf syntax. If the message string contains placeholder (beginning with %) an argument is expected to be part of the argument list of the calling method.

All log messages are written through the internal log_domain object to the sinks.

Constructor & Destructor Documentation

◆ logger()

matador::logger::logger ( std::string  source,
std::shared_ptr< log_domain log_domain 
)

Create a logger with a given source name connected to the given log_domain

Parameters
sourceThe name of the source
log_domainThe log_domain containing the log sinks

Member Function Documentation

◆ debug() [1/2]

template<typename ... ARGS>
void matador::logger::debug ( const char *  what,
ARGS const &...  args 
)
inline

Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ debug() [2/2]

template<typename ... ARGS>
void matador::logger::debug ( const std::string &  what,
ARGS const &...  args 
)
inline

Writes a log message string with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ domain()

std::string matador::logger::domain ( ) const

Returns the name of the connected log domain

Returns
The name of the log domain

◆ error() [1/2]

template<typename ... ARGS>
void matador::logger::error ( const char *  what,
ARGS const &...  args 
)
inline

Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ error() [2/2]

template<typename ... ARGS>
void matador::logger::error ( const std::string &  what,
ARGS const &...  args 
)
inline

Writes a log message string with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ fatal() [1/2]

template<typename ... ARGS>
void matador::logger::fatal ( const char *  what,
ARGS const &...  args 
)
inline

Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ fatal() [2/2]

template<typename ... ARGS>
void matador::logger::fatal ( const std::string &  what,
ARGS const &...  args 
)
inline

Writes a log message string with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ info() [1/2]

template<typename ... ARGS>
void matador::logger::info ( const char *  what,
ARGS const &...  args 
)
inline

Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ info() [2/2]

template<typename ... ARGS>
void matador::logger::info ( const std::string &  what,
ARGS const &...  args 
)
inline

Writes a log message string with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ log() [1/2]

void matador::logger::log ( log_level  lvl,
const char *  what 
)

Writes a log message represented by a char pointer with the given log level to the connected log_domain.

Parameters
lvlThe log level
whatThe message to log

◆ log() [2/2]

template<typename... ARGS>
void matador::logger::log ( log_level  lvl,
const char *  what,
ARGS const &...  args 
)

Writes a log message represented by a char pointer with the given log level to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
lvlThe log level
whatThe message to log
argsThe arguments to be replaced in the message

◆ source()

const std::string & matador::logger::source ( ) const

Returns the name of the source the logger represents

Returns
Represented log source name

◆ trace() [1/2]

template<typename ... ARGS>
void matador::logger::trace ( const char *  what,
ARGS const &...  args 
)
inline

Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ trace() [2/2]

template<typename ... ARGS>
void matador::logger::trace ( const std::string &  what,
ARGS const &...  args 
)
inline

Writes a log message string with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ warn() [1/2]

template<typename ... ARGS>
void matador::logger::warn ( const char *  what,
ARGS const &...  args 
)
inline

Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

◆ warn() [2/2]

template<typename ... ARGS>
void matador::logger::warn ( const std::string &  what,
ARGS const &...  args 
)
inline

Writes a log message string with log level LVL_FATAL to the connected log_domain.

Template Parameters
ARGSType of the arguments to replaced for the message placeholder
Parameters
whatThe message to log
argsThe arguments to be replaced in the message

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