Wrapper for spdlog::logger with additional pattern getter method. More...
Public Member Functions | |
Logger ()=default | |
Creates new empty logger. More... | |
Logger (const std::string &logger_name, PC_tree_t config, spdlog::level::level_enum level=spdlog::level::info) | |
Creates new logger. More... | |
Logger (Logger &parent_logger, const std::string &logger_name, PC_tree_t config) | |
Creates new logger with parent logger. More... | |
void | setup (const std::string &logger_name, PC_tree_t config, spdlog::level::level_enum level=spdlog::level::info) |
Sets up the logger. More... | |
void | setup (Logger &parent_logger, const std::string &logger_name, PC_tree_t config) |
Sets up the logger with parent logger. More... | |
void | pattern (const std::string &pattern) |
Changes pattern of the logger. More... | |
void | default_pattern (const std::string &pattern) |
Changes default pattern of the logger (won't be updated if current pattern is from config) More... | |
const std::string & | pattern () const |
Returns pattern of the logger. More... | |
void | level (spdlog::level::level_enum log_level) |
Sets logger level. More... | |
spdlog::level::level_enum | level () const |
Returns level of the logger. More... | |
void | evaluate_pattern (Context &ctx) const |
Evaluate pattern. More... | |
template<typename... Args> | |
void | trace (const char *fmt, Args &&... args) |
Writes trace level message. More... | |
template<typename... Args> | |
void | debug (const char *fmt, Args &&... args) |
Writes debug level message. More... | |
template<typename... Args> | |
void | info (const char *fmt, Args &&... args) |
Writes info level message. More... | |
template<typename... Args> | |
void | warn (const char *fmt, Args &&... args) |
Writes warning level message. More... | |
template<typename... Args> | |
void | error (const char *fmt, Args &&... args) |
Writes error level message. More... | |
std::shared_ptr< spdlog::logger > | real_logger () |
Returns real spdlog logger. More... | |
Wrapper for spdlog::logger with additional pattern getter method.
|
default |
Creates new empty logger.
PDI::Logger::Logger | ( | const std::string & | logger_name, |
PC_tree_t | config, | ||
spdlog::level::level_enum | level = spdlog::level::info |
||
) |
Creates new logger.
[in] | logger_name | logger name that will be displayed |
[in] | config | configuration tree from config file |
[in] | level | default level of the logger |
PDI::Logger::Logger | ( | Logger & | parent_logger, |
const std::string & | logger_name, | ||
PC_tree_t | config | ||
) |
Creates new logger with parent logger.
[in] | parent_logger | the logger to observe if default pattern has changed |
[in] | logger_name | logger name that will be displayed |
[in] | config | configuration tree from config file |
void PDI::Logger::setup | ( | const std::string & | logger_name, |
PC_tree_t | config, | ||
spdlog::level::level_enum | level = spdlog::level::info |
||
) |
Sets up the logger.
[in] | logger_name | logger name that will be displayed |
[in] | config | configuration tree from config file |
[in] | level | default level of the logger |
void PDI::Logger::setup | ( | Logger & | parent_logger, |
const std::string & | logger_name, | ||
PC_tree_t | config | ||
) |
Sets up the logger with parent logger.
[in] | parent_logger | the logger to observe if default pattern has changed |
[in] | logger_name | logger name that will be displayed |
[in] | config | configuration tree from config file |
void PDI::Logger::pattern | ( | const std::string & | pattern | ) |
Changes pattern of the logger.
[in] | pattern | pattern to set |
void PDI::Logger::default_pattern | ( | const std::string & | pattern | ) |
Changes default pattern of the logger (won't be updated if current pattern is from config)
[in] | pattern | pattern to set |
const std::string& PDI::Logger::pattern | ( | ) | const |
Returns pattern of the logger.
void PDI::Logger::level | ( | spdlog::level::level_enum | log_level | ) |
Sets logger level.
[in] | log_level | level to set |
spdlog::level::level_enum PDI::Logger::level | ( | ) | const |
Returns level of the logger.
void PDI::Logger::evaluate_pattern | ( | Context & | ctx | ) | const |
Evaluate pattern.
[in] | ctx | the context in which to evaluate the pattern |
|
inline |
Writes trace level message.
[in] | fmt | fmt formatted string |
[in] | args | arguments for fmt string |
|
inline |
Writes debug level message.
[in] | fmt | fmt formatted string |
[in] | args | arguments for fmt string |
|
inline |
Writes info level message.
[in] | fmt | fmt formatted string |
[in] | args | arguments for fmt string |
|
inline |
Writes warning level message.
[in] | fmt | fmt formatted string |
[in] | args | arguments for fmt string |
|
inline |
Writes error level message.
[in] | fmt | fmt formatted string |
[in] | args | arguments for fmt string |
std::shared_ptr<spdlog::logger> PDI::Logger::real_logger | ( | ) |
Returns real spdlog logger.