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 | |
logger & | operator= (const logger &l)=delete |
logger & | operator= (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 |
logger to write log messages to log domains
This class is used to write log messages to a connected log domain (
The interface provides methods to log to each relevant 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.
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
source | The name of the source |
log_domain | The log_domain containing the log sinks |
|
inline |
Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message string with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
std::string matador::logger::domain | ( | ) | const |
Returns the name of the connected log domain
|
inline |
Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message string with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message string with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message string with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
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.
lvl | The log level |
what | The message to log |
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.
ARGS | Type of the arguments to replaced for the message placeholder |
lvl | The log level |
what | The message to log |
args | The arguments to be replaced in the message |
const std::string & matador::logger::source | ( | ) | const |
Returns the name of the source the logger represents
|
inline |
Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message string with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message represented by a char pointer with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |
|
inline |
Writes a log message string with log level LVL_FATAL to the connected log_domain.
ARGS | Type of the arguments to replaced for the message placeholder |
what | The message to log |
args | The arguments to be replaced in the message |