DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
dcmtk::log4cplus::spi::LoggerImpl Class Reference

This is the central class in the log4cplus package. More...

+ Inheritance diagram for dcmtk::log4cplus::spi::LoggerImpl:

Public Member Functions

virtual void callAppenders (const InternalLoggingEvent &event)
 Call the appenders in the hierrachy starting at this. More...
 
virtual void closeNestedAppenders ()
 Close all attached appenders implementing the AppenderAttachable interface.
 
virtual bool isEnabledFor (LogLevel ll) const
 Check whether this logger is enabled for a given LogLevel passed as parameter. More...
 
virtual void log (LogLevel ll, const log4cplus::tstring &message, const char *file=NULL, int line=-1)
 This generic form is intended to be used by wrappers.
 
virtual LogLevel getChainedLogLevel () const
 Starting from this logger, search the logger hierarchy for a "set" LogLevel and return it. More...
 
LogLevel getLogLevel () const
 Returns the assigned LogLevel, if any, for this Logger. More...
 
void setLogLevel (LogLevel _ll)
 Set the LogLevel of this Logger.
 
virtual HierarchygetHierarchy () const
 Return the the Hierarchy where this Logger instance is attached.
 
log4cplus::tstring const & getName () const
 Return the logger name.
 
bool getAdditivity () const
 Get the additivity flag for this Logger instance.
 
void setAdditivity (bool additive)
 Set the additivity flag for this Logger instance.
 
- Public Member Functions inherited from dcmtk::log4cplus::helpers::AppenderAttachableImpl
virtual void addAppender (SharedAppenderPtr newAppender)
 Add an appender. More...
 
virtual SharedAppenderPtrList getAllAppenders ()
 Get all previously added appenders as an vectory.
 
virtual SharedAppenderPtr getAppender (const log4cplus::tstring &name)
 Look for an attached appender named as name. More...
 
virtual void removeAllAppenders ()
 Remove all previously added appenders.
 
virtual void removeAppender (SharedAppenderPtr appender)
 Remove the appender passed as parameter from the list of appenders.
 
virtual void removeAppender (const log4cplus::tstring &name)
 Remove the appender with the name passed as parameter from the list of appenders.
 
int appendLoopOnAppenders (const spi::InternalLoggingEvent &event) const
 Call the doAppend method on all attached appenders.
 

Protected Member Functions

 LoggerImpl (const log4cplus::tstring &name, Hierarchy &h)
 This constructor created a new Logger instance and sets its name. More...
 
virtual void forcedLog (LogLevel ll, const log4cplus::tstring &message, const char *file=NULL, int line=-1)
 This method creates a new logging event and logs the event without further checks.
 

Protected Attributes

log4cplus::tstring name
 The name of this logger.
 
LogLevel ll
 The assigned LogLevel of this logger.
 
SharedLoggerImplPtr parent
 The parent of this logger. More...
 
bool additive
 Additivity is set to true by default, that is children inherit the appenders of their ancestors by default. More...
 
- Protected Attributes inherited from dcmtk::log4cplus::helpers::AppenderAttachableImpl
ListType appenderList
 Array of appenders. More...
 

Private Attributes

Hierarchyhierarchy
 Loggers need to know what Hierarchy they are in. More...
 

Detailed Description

This is the central class in the log4cplus package.

One of the distintive features of log4cplus are hierarchical loggers and their evaluation.

See the user manual for an introduction on this class.

Constructor & Destructor Documentation

dcmtk::log4cplus::spi::LoggerImpl::LoggerImpl ( const log4cplus::tstring name,
Hierarchy h 
)
protected

This constructor created a new Logger instance and sets its name.

It is intended to be used by sub-classes only. You should not create loggers directly.

Parameters
nameThe name of the logger.
hHierarchy

Member Function Documentation

virtual void dcmtk::log4cplus::spi::LoggerImpl::callAppenders ( const InternalLoggingEvent event)
virtual

Call the appenders in the hierrachy starting at this.

If no appenders could be found, emit a warning.

This method calls all the appenders inherited from the hierarchy circumventing any evaluation of whether to log or not to log the particular log request.

Parameters
eventThe event to log.
virtual LogLevel dcmtk::log4cplus::spi::LoggerImpl::getChainedLogLevel ( ) const
virtual

Starting from this logger, search the logger hierarchy for a "set" LogLevel and return it.

Otherwise, return the LogLevel of the root logger.

The Logger class is designed so that this method executes as quickly as possible.

Reimplemented in dcmtk::log4cplus::spi::RootLogger.

LogLevel dcmtk::log4cplus::spi::LoggerImpl::getLogLevel ( ) const
inline

Returns the assigned LogLevel, if any, for this Logger.

Returns
LogLevel - the assigned LogLevel.
virtual bool dcmtk::log4cplus::spi::LoggerImpl::isEnabledFor ( LogLevel  ll) const
virtual

Check whether this logger is enabled for a given LogLevel passed as parameter.

Returns
boolean True if this logger is enabled for ll.

Member Data Documentation

bool dcmtk::log4cplus::spi::LoggerImpl::additive
protected

Additivity is set to true by default, that is children inherit the appenders of their ancestors by default.

If this variable is set to false then the appenders found in the ancestors of this logger are not used. However, the children of this logger will inherit its appenders, unless the children have their additivity flag set to false too. See the user manual for more details.

Hierarchy& dcmtk::log4cplus::spi::LoggerImpl::hierarchy
private

Loggers need to know what Hierarchy they are in.

SharedLoggerImplPtr dcmtk::log4cplus::spi::LoggerImpl::parent
protected

The parent of this logger.

All loggers have at least one ancestor which is the root logger.


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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8