Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

Qmms::Log::AppenderSkeleton Class Reference

Abstract base class for all Appenders. More...

#include <log.hh>

Inheritance diagram for Qmms::Log::AppenderSkeleton::

Qmms::Log::Appender Qmms::Log::LayoutAppender Qmms::Log::SMTPAppender Qmms::Log::SocketAppender Qmms::Log::StreamAppender Qmms::Log::SyslogAppender Qmms::Log::TextEditAppender Qmms::Log::ConsoleAppender Qmms::Log::FileAppender Qmms::Log::RollingFileAppender List of all members.

Public Methods

 AppenderSkeleton ()
 Default constructor does nothing. More...

 AppenderSkeleton (const QString &name)
 Constructor. More...

virtual ~AppenderSkeleton ()
 Destructor. More...

virtual void append (LoggingEvent *evnt)=0
 Takes a LoggingEvent and writes it in the appropriate fashion. More...

virtual bool checkEntryConditions () const=0
 Used to check that the appender is ready to append. More...

void doAppend (LoggingEvent *evnt)
 Calls append() after first checking that certain conditions are met. More...

void setName (const QString &name)
 Accessor method Sets the name of this Appender. More...

QString getName () const
 Accessor method. More...

void setThreshold (const QString &thold)
 Accessor method Sets the threshold for this Appender. More...

QString getThreshold () const
 Accessor method. More...

bool isAsSevereAsThreshold (const QString lvl) const
 Compares a given loglevel against the Appender's threshold, if any. More...

virtual bool requiresLayout () const=0
 Subclasses implement this to return the appropriate value depending on whether they require a layout or not. More...


Protected Attributes

QString name
 The name of this Appender. More...

QString threshold
 The threshold (if any) of this Appender. More...


Detailed Description

Abstract base class for all Appenders.

This is a true abstract class since it actually defines some methods and members. Subclasses must of course implement the purely virtual methods.


Constructor & Destructor Documentation

Qmms::Log::AppenderSkeleton::AppenderSkeleton  
 

Default constructor does nothing.

Qmms::Log::AppenderSkeleton::AppenderSkeleton const QString   name
 

Constructor.

Parameters:
name  the name of the appender

virtual Qmms::Log::AppenderSkeleton::~AppenderSkeleton   [virtual]
 

Destructor.


Member Function Documentation

virtual void Qmms::Log::AppenderSkeleton::append LoggingEvent   evnt [pure virtual]
 

Takes a LoggingEvent and writes it in the appropriate fashion.

Subclasses must implement this method in an appender-specific manner.

This method is usually called from doAppend(), because doAppend checks that the threshold (if any) of the appender is not less than the loglevel of the calling category.

Parameters:
evnt  pointer to the LoggingEvent to append

Reimplemented in Qmms::Log::LayoutAppender, and Qmms::Log::SMTPAppender.

virtual bool Qmms::Log::AppenderSkeleton::checkEntryConditions   const [pure virtual]
 

Used to check that the appender is ready to append.

Subclasses must implement this method.

Returns:
true if appender is ready, false otherwise

Reimplemented in Qmms::Log::LayoutAppender, Qmms::Log::StreamAppender, and Qmms::Log::SMTPAppender.

void Qmms::Log::AppenderSkeleton::doAppend LoggingEvent   evnt [virtual]
 

Calls append() after first checking that certain conditions are met.

Usually called from callAppenders() in Category.

Parameters:
evnt  pointer to the LoggingEvent to append

Reimplemented from Qmms::Log::Appender.

QString Qmms::Log::AppenderSkeleton::getName   const [virtual]
 

Accessor method.

Returns:
the name of this Appender

Reimplemented from Qmms::Log::Appender.

QString Qmms::Log::AppenderSkeleton::getThreshold   const
 

Accessor method.

Returns:
the threshold of this Appender

bool Qmms::Log::AppenderSkeleton::isAsSevereAsThreshold const QString    lvl const
 

Compares a given loglevel against the Appender's threshold, if any.

Parameters:
lvl  to be compared against Appender's threshold
Returns:
true if the Appender has no threshold OR if the level is greater than the threshold, false otherwise

virtual bool Qmms::Log::AppenderSkeleton::requiresLayout   const [pure virtual]
 

Subclasses implement this to return the appropriate value depending on whether they require a layout or not.

Reimplemented in Qmms::Log::LayoutAppender, Qmms::Log::StreamAppender, and Qmms::Log::SMTPAppender.

void Qmms::Log::AppenderSkeleton::setName const QString   name [virtual]
 

Accessor method Sets the name of this Appender.

Parameters:
name  the name of this Appender

Reimplemented from Qmms::Log::Appender.

void Qmms::Log::AppenderSkeleton::setThreshold const QString   thold
 

Accessor method Sets the threshold for this Appender.

Parameters:
thold  reference to the threshold to set


Member Data Documentation

QString Qmms::Log::AppenderSkeleton::name [protected]
 

The name of this Appender.

QString Qmms::Log::AppenderSkeleton::threshold [protected]
 

The threshold (if any) of this Appender.


The documentation for this class was generated from the following file:
Generated on Fri Jan 3 15:04:01 2003 for QmmsLog by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001