Use this class to access the Default Logger. More...
#include <kanzi/core/log/default_logger.hpp>
Static Public Member Functions | |
static AbstractLogger & | get () |
Gets the reference to the Default Logger object. More... | |
static void | popAllLoggers () |
Removes all custom loggers registered within the Default Logger object. More... | |
static void | popLogger () |
Removes the last pushed logger from the Default Logger object. More... | |
static void | pushLogger (AbstractLoggerUniquePtr &&logger) |
Pushes a custom logger to the Default Logger object. More... | |
Use this class to access the Default Logger.
The Default Logger inherits from kanzi::AbstractLogger. It is a container for an arbitrary number of other loggers.
To add a logger to the Default Logger object, use pushLogger. The implementation of the AbstractLogger::writeOverride function in the Default Logger writes log messages to all the loggers that the Default Logger contains.
To remove the last added logger from the Default Logger, use popLogger. To remove all loggers from the Default Logger, use popAllLoggers.
To get the reference to the Default Logger object, use get.
The Logging macros use the Default Logger to write log messages.
|
static |
Pushes a custom logger to the Default Logger object.
Use this function to append a new custom logger to be used by the Default Logger to write log messages.
logger | new logger to be registered within default logger. |
|
static |
Removes the last pushed logger from the Default Logger object.
When you no longer need the logger which was last pushed to the Default Logger object, use this function to remove that logger.
|
static |
Removes all custom loggers registered within the Default Logger object.
When you call this function, all custom loggers that were pushed with pushLogger() are popped from the Default Logger object. After you call this function, the log messages written using the Default Logger object are not written anywhere.
|
static |
Gets the reference to the Default Logger object.