Provides interface to write log messages to multiple loggers. More...
#include <kanzi/core/log/chained_logger.hpp>
Public Types | |
typedef unique_ptr< AbstractLogger > | AbstractLoggerUniquePtr |
Typedef of the kanzi::AbstractLogger unique pointer. More... | |
typedef vector< AbstractLoggerUniquePtr > | AbstractLoggerVector |
Typedef of vector holding kanzi::AbstractLogger unique pointers. More... | |
Public Member Functions | |
void | push (AbstractLogger *logger) |
Registers new logger. More... | |
void | pop () |
Removes last registered logger. More... | |
void | popAll () |
Removes all registered loggers. More... | |
Public Member Functions inherited from kanzi::AbstractLogger | |
void | write (LogLevel level, string_view levelName, string_view categoryName, string_view fileName, size_t lineNumber, string_view message) |
This function is called by Kanzi to store the message to the log. More... | |
virtual | ~AbstractLogger () |
Destructor. More... | |
Protected Member Functions | |
virtual void | writeOverride (LogLevel level, string_view levelName, string_view categoryName, string_view fileName, size_t lineNumber, string_view message) KZ_OVERRIDE |
Writes log message using registered loggers. More... | |
Provides interface to write log messages to multiple loggers.
typedef unique_ptr<AbstractLogger> kanzi::detail::ChainedLogger::AbstractLoggerUniquePtr |
Typedef of the kanzi::AbstractLogger unique pointer.
Typedef of vector holding kanzi::AbstractLogger unique pointers.
void kanzi::detail::ChainedLogger::push | ( | AbstractLogger * | logger | ) |
Registers new logger.
logger | New logger. |
|
inline |
Removes last registered logger.
|
inline |
Removes all registered loggers.
|
protectedvirtual |
Writes log message using registered loggers.
See kanzi::AbstractLogger::writeOverride for details.
level | The log level of the message. |
levelName | The string representation of log level. |
categoryName | The string representation of log category. |
fileName | The name of the file log message is originated from. |
lineNumber | The line number of the place in file where log message is originated. |
message | The message being written to the log. |
Implements kanzi::AbstractLogger.