Use this class to access the Default Logger. More...
#include <kanzi/core/log/default_logger.hpp>
Static Public Member Functions | |
static void | pushLogger (AbstractLoggerUniquePtr logger) |
Pushes a custom logger to the Default Logger object and takes the ownership of that logger. More... | |
static void | pushLogger (AbstractLogger *logger) |
Pushes a custom logger to the Default Logger object and takes the ownership of that logger. More... | |
static void | popLogger () |
Removes the last pushed logger from the Default Logger object. More... | |
static void | popAllLoggers () |
Removes all custom loggers registered within the Default Logger object. More... | |
static AbstractLogger & | get () |
Gets the reference 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 and takes the ownership of that logger.
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 the default logger. |
|
inlinestatic |
Pushes a custom logger to the Default Logger object and takes the ownership of that logger.
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 the default logger. You must allocate the logger dynamically with the new expression. |
|
inlinestatic |
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.
|
inlinestatic |
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.
|
inlinestatic |
Gets the reference to the Default Logger object.