MySQL 9.1.0
Source Code Documentation
|
Logger class. More...
#include <logger.h>
Public Member Functions | |
Logger (Registry ®istry, LogLevel level=kDefaultLogLevel) | |
Logger () | |
void | attach_handler (std::string name) |
void | detach_handler (std::string name, bool handler_must_exist=true) |
void | handle (const Record &record) |
void | lazy_handle (LogLevel record_level, std::function< Record()> record_creator) const |
bool | is_handled (LogLevel level) const |
check if the log-level will be handled. More... | |
const std::set< std::string > & | get_handler_names () const |
void | set_level (LogLevel level) |
LogLevel | get_level () const |
void | set_timestamp_precision (LogTimestampPrecision precision) |
LogTimestampPrecision | get_timestamp_precision () const |
Private Attributes | |
LogLevel | level_ |
LogTimestampPrecision | precision_ |
std::set< std::string > | handlers_ |
const Registry * | registry_ |
Logger class.
The logger class handles the logging for one or more logging handlers. Each logger class instance keeps state for logging for one module or subsystem. You can add handlers to a logger which will then be used for all logging to that subsystem.
|
explicit |
|
inline |
void mysql_harness::logging::Logger::attach_handler | ( | std::string | name | ) |
void mysql_harness::logging::Logger::detach_handler | ( | std::string | name, |
bool | handler_must_exist = true |
||
) |
|
inline |
|
inline |
|
inline |
void mysql_harness::logging::Logger::handle | ( | const Record & | record | ) |
bool mysql_harness::logging::Logger::is_handled | ( | LogLevel | level | ) | const |
check if the log-level will be handled.
log-messages may be filtered on global and on handler level.
in case it is not handled, there is no need call the prepare data for the log-function.
true | log-level (quite likely) will be handled |
false | log-level will be ignored |
void mysql_harness::logging::Logger::lazy_handle | ( | LogLevel | record_level, |
std::function< Record()> | record_creator | ||
) | const |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |