kanzi::DefaultLogger Class Reference

This class provides interface to access Default Logger. More...

#include <kanzi/core/log/default_logger.hpp>

Static Public Member Functions

static void pushLogger (AbstractLogger *logger)
 Pushes new custom logger to Default Logger object. More...
 
static void popLogger ()
 Pops last pushed logger from Default Logger object. More...
 
static void popAllLoggers ()
 This method removes all custom loggers registered within Default Logger object. More...
 
static AbstractLoggerget ()
 This method is used to obtain reference to Default Logger object. More...
 

Detailed Description

This class provides interface to access Default Logger.

The Default Logger inherits from kanzi::AbstractLogger. It is container for arbitrary number of other loggers. Method pushLogger should be used to add new logger to the Default Logger object. Implementation of the writeOverride method in Default Logger writes log messages to all loggers Default Logger contains. Method popLogger could be used to remove last added logger from Default Logger. In order to remove all logger from Default Logger popAllLoggers should be used. The reference to Default Logger object is obtained with get method. There as several Logging macros macros that use Default Logger to write log messages. The Default Logger is used by Logging macros to write log messages.

Member Function Documentation

static void kanzi::DefaultLogger::pushLogger ( AbstractLogger logger)
inlinestatic

Pushes new custom logger to Default Logger object.

This method is used to append new custom logger to be used by Default Logger to write log messages.

Parameters
loggernew logger to be registered within default logger.
static void kanzi::DefaultLogger::popLogger ( )
inlinestatic

Pops last pushed logger from Default Logger object.

This method should be used in cases when last pushed logger is not needed any more.

static void kanzi::DefaultLogger::popAllLoggers ( )
inlinestatic

This method removes all custom loggers registered within Default Logger object.

The effect of calling this method is all custom loggers previosly pushed with pushLogger() are popped from Default Logger object. The consequence is log messages written using Default Logger object are not written anywhere so that logging becomes silent.

static AbstractLogger& kanzi::DefaultLogger::get ( )
inlinestatic

This method is used to obtain reference to Default Logger object.

Returns
Default Logger object.

The documentation for this class was generated from the following file: