Abstract class providing integration with external loggers. More...
#include <logger-aware.hpp>
Public Member Functions | |
LoggerAware (const LoggerAware &)=default | |
LoggerAware & | operator= (const LoggerAware &)=default |
LoggerAware (LoggerAware &&)=default | |
LoggerAware & | operator= (LoggerAware &&)=default |
virtual | ~LoggerAware ()=default |
void | set_logger (ILogger *logger) |
Update the internal logger pointer. | |
Protected Member Functions | |
LoggerAware ()=default | |
Default constructor. | |
LoggerAware (ILogger *logger) | |
Constructor using an existing logger. | |
void | log_debug (std::string_view msg) |
Log a message with DEBUG (or equivalent) level. | |
void | log_info (std::string_view msg) |
Log a message with INFO (or equivalent) level. | |
void | log_warning (std::string_view msg) |
Log a message with WARNING (or equivalent) level. | |
void | log_error (std::string_view msg) |
Log a message with ERROR (or equivalent) level. | |
void | log_critical (std::string_view msg) |
Log a message with CRITICAL (or equivalent) level. | |
Private Attributes | |
ILogger * | m_logger |
Abstract class providing integration with external loggers.
The integration is provided via the ILogger interface. This class expects to receive a pointer to an object implementing the ILogger interface, which will be used by the internal logging methods to determine whether the message received can be sent to a logger or not.
|
default |
|
default |
|
virtualdefault |
|
protecteddefault |
Default constructor.
|
inlineexplicitprotected |
Constructor using an existing logger.
[in] | logger | Pointer to the logger to use. Set to ǹullptr` to disable logging. |
|
inlineprotected |
Log a message with CRITICAL (or equivalent) level.
|
inlineprotected |
Log a message with DEBUG (or equivalent) level.
|
inlineprotected |
Log a message with ERROR (or equivalent) level.
|
inlineprotected |
Log a message with INFO (or equivalent) level.
|
inlineprotected |
Log a message with WARNING (or equivalent) level.
|
default |
|
default |
Update the internal logger pointer.
[in] | logger | Pointer to the logger to use. Set to nullptr to disable logging. |
|
private |