Log4Qt::AppenderSkeleton Class Reference

The class AppenderSkeleton implements general Appender functionality. More...

#include <appenderskeleton.h>

Inheritance diagram for Log4Qt::AppenderSkeleton:

Log4Qt::Appender Log4Qt::LogObject Log4Qt::DebugAppender Log4Qt::ListAppender Log4Qt::NullAppender Log4Qt::WriterAppender Log4Qt::ConsoleAppender Log4Qt::FileAppender Log4Qt::DailyRollingFileAppender Log4Qt::RollingFileAppender

List of all members.

Public Member Functions

 AppenderSkeleton (QObject *pParent=0)
virtual Filterfilter () const
virtual Layoutlayout () const
bool isActive () const
bool isClosed () const
virtual QString name () const
Level threshold () const
virtual void setLayout (Layout *pLayout)
virtual void setName (const QString &rName)
void setThreshold (Level level)
virtual void activateOptions ()
virtual void addFilter (Filter *pFilter)
virtual void clearFilters ()
virtual void close ()
virtual void doAppend (const LoggingEvent &rEvent)
FilterfirstFilter () const
bool isAsSevereAsThreshold (Level level) const

Protected Member Functions

 AppenderSkeleton (const bool isActive, QObject *pParent=0)
virtual void append (const LoggingEvent &rEvent)=0
virtual bool checkEntryConditions () const

Protected Attributes

QMutex mObjectGuard

Properties

bool isActive
bool isClosed
Level threshold


Detailed Description

The class AppenderSkeleton implements general Appender functionality.

Note:
All the functions declared in this class are thread-safe.

The ownership and lifetime of objects of this class are managed. See Object ownership for more details.


Constructor & Destructor Documentation

Log4Qt::AppenderSkeleton::AppenderSkeleton ( QObject *  pParent = 0  ) 

Log4Qt::AppenderSkeleton::AppenderSkeleton ( const bool  isActive,
QObject *  pParent = 0 
) [protected]


Member Function Documentation

Filter * Log4Qt::AppenderSkeleton::filter (  )  const [inline, virtual]

Implements Log4Qt::Appender.

Referenced by firstFilter().

Layout * Log4Qt::AppenderSkeleton::layout (  )  const [inline, virtual]

Implements Log4Qt::Appender.

References mObjectGuard.

bool Log4Qt::AppenderSkeleton::isActive (  )  const

bool Log4Qt::AppenderSkeleton::isClosed (  )  const

QString Log4Qt::AppenderSkeleton::name (  )  const [inline, virtual]

Implements Log4Qt::Appender.

References mObjectGuard.

Level Log4Qt::AppenderSkeleton::threshold (  )  const

void Log4Qt::AppenderSkeleton::setLayout ( Layout pLayout  )  [inline, virtual]

Implements Log4Qt::Appender.

References mObjectGuard.

void Log4Qt::AppenderSkeleton::setName ( const QString &  rName  )  [inline, virtual]

Implements Log4Qt::Appender.

References mObjectGuard.

void Log4Qt::AppenderSkeleton::setThreshold ( Level  level  )  [inline]

virtual void Log4Qt::AppenderSkeleton::activateOptions (  )  [virtual]

virtual void Log4Qt::AppenderSkeleton::addFilter ( Filter pFilter  )  [virtual]

Implements Log4Qt::Appender.

virtual void Log4Qt::AppenderSkeleton::clearFilters (  )  [virtual]

Implements Log4Qt::Appender.

virtual void Log4Qt::AppenderSkeleton::close (  )  [virtual]

virtual void Log4Qt::AppenderSkeleton::doAppend ( const LoggingEvent rEvent  )  [virtual]

Performs checks and delegates the actuall appending to the subclass specific append() function.

See also:
append(), checkEntryConditions(), isAsSevereAsThreshold(), Filter

Implements Log4Qt::Appender.

Filter * Log4Qt::AppenderSkeleton::firstFilter (  )  const [inline]

References filter(), and mObjectGuard.

bool Log4Qt::AppenderSkeleton::isAsSevereAsThreshold ( Level  level  )  const [inline]

virtual void Log4Qt::AppenderSkeleton::append ( const LoggingEvent rEvent  )  [protected, pure virtual]

virtual bool Log4Qt::AppenderSkeleton::checkEntryConditions (  )  const [protected, virtual]

Tests if all entry conditions for using append() in this class are met.

If a conditions is not met, an error is logged and the function returns false.

The checked conditions are:

  • That the appender has been activated (APPENDER_NOT_ACTIVATED_ERROR)
  • That the appender was not closed (APPENDER_CLOSED_ERROR)
  • That the appender has a layout set, if it requires one (logging_error(APPENDER_USE_MISSING_LAYOUT_ERROR)

The function is called as part of the checkEntryConditions() chain started by doAppend(). The doAppend() function calls the subclass specific checkEntryConditions() function. The function checks the class specific conditions and calls checkEntryConditions() of it's parent class. The last function called is AppenderSkeleton::checkEntryConditions().

See also:
doAppend()

Reimplemented in Log4Qt::DailyRollingFileAppender, Log4Qt::FileAppender, and Log4Qt::WriterAppender.


Member Data Documentation

QMutex Log4Qt::AppenderSkeleton::mObjectGuard [mutable, protected]


Property Documentation

bool Log4Qt::AppenderSkeleton::isActive [inline, read]

The property holds if the Appender has been activated.

See also:
isActive()

bool Log4Qt::AppenderSkeleton::isClosed [inline, read]

The property holds if the Appender has been closed.

See also:
isClosed()

Level Log4Qt::AppenderSkeleton::threshold [inline, read, write]

The property holds the threshold level used by the Appender.

See also:
threshold(), setThreshold()


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

Generated on Sun Mar 1 16:40:45 2009 for Log4Qt by  doxygen 1.5.6