Apache Log4cxx  Version 1.2.0
Loading...
Searching...
No Matches
log4cxx::LevelChange Class Reference

Changes a verbosity level for the instance variable's lifetime. More...

#include <levelchange.h>

Public Member Functions

 LevelChange (const LoggerPtr &otherCategory, const LevelPtr &level)
 Set otherCategory to level.
 
 LevelChange (const LoggerPtr &otherCategory, const LoggerPtr &thisCategory)
 Set otherCategory to the level of thisCategory.
 
template<class StringType >
 LevelChange (const StringType &otherCategory, const LevelPtr &level)
 Set the logger named otherCategory to level.
 
template<class StringType >
 LevelChange (const StringType &otherCategory, const LoggerPtr &thisCategory)
 Set the logger named otherCategory to the level of thisCategory.
 
 ~LevelChange ()
 Restore the verbosity level of the other logger.
 

Detailed Description

Changes a verbosity level for the instance variable's lifetime.

Create a LevelChange variable on the stack to temporarily (e.g. for a single method) increase the quantity of information logged.

Typically used to propagate the locally used logger's level (e.g. DEBUG or TRACE) to another named (e.g. the name of the class of the method invoked next) logger.

The LevelChange variable does not need to be removed from the code (e.g. for a release build) as it has no impact when the local and other logger point to the same level (e.g. null_ptr, implying their level is inherited).

Constructor & Destructor Documentation

◆ LevelChange() [1/4]

log4cxx::LevelChange::LevelChange ( const LoggerPtr otherCategory,
const LevelPtr level 
)
inline

Set otherCategory to level.

◆ LevelChange() [2/4]

log4cxx::LevelChange::LevelChange ( const LoggerPtr otherCategory,
const LoggerPtr thisCategory 
)
inline

Set otherCategory to the level of thisCategory.

◆ LevelChange() [3/4]

template<class StringType >
log4cxx::LevelChange::LevelChange ( const StringType &  otherCategory,
const LevelPtr level 
)
inline

Set the logger named otherCategory to level.

◆ LevelChange() [4/4]

template<class StringType >
log4cxx::LevelChange::LevelChange ( const StringType &  otherCategory,
const LoggerPtr thisCategory 
)
inline

Set the logger named otherCategory to the level of thisCategory.

◆ ~LevelChange()

log4cxx::LevelChange::~LevelChange ( )
inline

Restore the verbosity level of the other logger.


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