Apache Log4cxx  Version 1.3.1
Loading...
Searching...
No Matches
log4cxx::LoggerInstancePtr Class Reference

A smart pointer (implicity convertable to LoggerPtr) that conditionally removes a Logger from the spi::LoggerRepository at the end of the instance variable's lifetime. More...

#include <loggerinstance.h>

Public Member Functions

 LoggerInstancePtr ()
 A null LoggerPtr.
 
template<class StringType >
 LoggerInstancePtr (const StringType &instanceName)
 A separately configurable logger named instanceName.
 
 ~LoggerInstancePtr ()
 Conditionally remove the logger from the the spi::LoggerRepository.
 
const LoggerPtroperator-> () const noexcept
 
 operator bool () const noexcept
 
 operator LoggerPtr & () noexcept
 
 operator const LoggerPtr & () const noexcept
 
Loggerget () noexcept
 
const Loggerget () const noexcept
 
void reset ()
 Conditionally remove the Logger from the spi::LoggerRepository.
 
template<class StringType >
void reset (const StringType &instanceName)
 Change this to a logger named instanceName.
 

Detailed Description

A smart pointer (implicity convertable to LoggerPtr) that conditionally removes a Logger from the spi::LoggerRepository at the end of the instance variable's lifetime.

If the configuration process loaded settings for the logger, or the logger is referenced elsewhere, the LoggerInstancePtr destructor will not remove it from the spi::LoggerRepository.

Use a LoggerInstancePtr to prevent unbounded growth of data in the spi::LoggerRepository when using runtime generated logger names.

A runtime generated logger name is a technique for marking logging messages that allows control of the logger level at a class instance level (i.e. a per object logger).

A per object logger is useful when the object instance has a identifiable name (e.g. when it is instantiated from configuration data).

Constructor & Destructor Documentation

◆ LoggerInstancePtr() [1/2]

log4cxx::LoggerInstancePtr::LoggerInstancePtr ( )
inline

A null LoggerPtr.

◆ LoggerInstancePtr() [2/2]

template<class StringType >
log4cxx::LoggerInstancePtr::LoggerInstancePtr ( const StringType &  instanceName)
inline

A separately configurable logger named instanceName.

◆ ~LoggerInstancePtr()

log4cxx::LoggerInstancePtr::~LoggerInstancePtr ( )
inline

Conditionally remove the logger from the the spi::LoggerRepository.

Member Function Documentation

◆ get() [1/2]

const Logger * log4cxx::LoggerInstancePtr::get ( ) const
inlinenoexcept

◆ get() [2/2]

Logger * log4cxx::LoggerInstancePtr::get ( )
inlinenoexcept

◆ operator bool()

log4cxx::LoggerInstancePtr::operator bool ( ) const
inlineexplicitnoexcept

◆ operator const LoggerPtr &()

log4cxx::LoggerInstancePtr::operator const LoggerPtr & ( ) const
inlinenoexcept

◆ operator LoggerPtr &()

log4cxx::LoggerInstancePtr::operator LoggerPtr & ( )
inlinenoexcept

◆ operator->()

const LoggerPtr & log4cxx::LoggerInstancePtr::operator-> ( ) const
inlinenoexcept

◆ reset() [1/2]

void log4cxx::LoggerInstancePtr::reset ( )
inline

Conditionally remove the Logger from the spi::LoggerRepository.

◆ reset() [2/2]

template<class StringType >
void log4cxx::LoggerInstancePtr::reset ( const StringType &  instanceName)
inline

Change this to a logger named instanceName.


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