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

Qmms::Log::StreamAppender Class Reference

Abstract base class for any appenders that use a stream. More...

#include <log.hh>

Inheritance diagram for Qmms::Log::StreamAppender::

Qmms::Log::LayoutAppender Qmms::Log::AppenderSkeleton Qmms::Log::Appender Qmms::Log::ConsoleAppender Qmms::Log::FileAppender Qmms::Log::RollingFileAppender List of all members.

Public Methods

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

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

 StreamAppender (const QString &name, Layout *lyt)
 Constructor. More...

virtual ~StreamAppender ()
 Destructor does nothing. More...

virtual void subAppend (LoggingEvent *evnt)
 Logs the event immediately with no further checks of any kind. More...

virtual bool checkEntryConditions () const
 Checks that the output stream is open, after calling base class's checkEntryConditions() first. More...

virtual void open (QString &name)=0
 Pure virtual function that is used to open the stream when subclassed. More...

virtual void close ()
 Closes the appending stream. More...

bool requiresLayout () const
 Specifies whether this Appender requires a Layout. More...

bool getImmediateFlush () const
void setImmediateFlush (const bool flush)
 Sets the value of the property variable immediateFlush. More...


Protected Attributes

bool immediateFlush
 Determines whether to flush immediately upon logging or to cache events until explicitly flushed. More...

QFile out
 The "stream" to which to append LoggingEvents. More...


Detailed Description

Abstract base class for any appenders that use a stream.

Appends log events to a QFile, which can point to any stream. Must be subclassed! Extends the abstract class AppenderSkeleton.


Constructor & Destructor Documentation

Qmms::Log::StreamAppender::StreamAppender  
 

Default constructor does nothing.

Qmms::Log::StreamAppender::StreamAppender const QString   name
 

Constructor.

Passes name to base class constructor.

Parameters:
name  the name of the Appender

Qmms::Log::StreamAppender::StreamAppender const QString   name,
Layout   lyt
 

Constructor.

Passes both params to base class contructors.

Parameters:
name  the name of the Appender
lyt  the Layout to use

virtual Qmms::Log::StreamAppender::~StreamAppender   [virtual]
 

Destructor does nothing.


Member Function Documentation

virtual bool Qmms::Log::StreamAppender::checkEntryConditions   const [virtual]
 

Checks that the output stream is open, after calling base class's checkEntryConditions() first.

Returns:
true if conditions are met, false otherwise

Reimplemented from Qmms::Log::LayoutAppender.

virtual void Qmms::Log::StreamAppender::close   [virtual]
 

Closes the appending stream.

Reimplemented from Qmms::Log::Appender.

bool Qmms::Log::StreamAppender::getImmediateFlush   const
 

Returns:
the value of the property variable immediateFlush

virtual void Qmms::Log::StreamAppender::open QString   name [pure virtual]
 

Pure virtual function that is used to open the stream when subclassed.

Parameters:
name  the name of the stream, according to the type of Appender subclassed.

Reimplemented in Qmms::Log::ConsoleAppender, and Qmms::Log::FileAppender.

bool Qmms::Log::StreamAppender::requiresLayout   const [virtual]
 

Specifies whether this Appender requires a Layout.

Returns:
true, since output streams require a Layout

Reimplemented from Qmms::Log::LayoutAppender.

void Qmms::Log::StreamAppender::setImmediateFlush const bool    flush
 

Sets the value of the property variable immediateFlush.

virtual void Qmms::Log::StreamAppender::subAppend LoggingEvent   evnt [virtual]
 

Logs the event immediately with no further checks of any kind.

Recall the order of things:

Reimplemented from Qmms::Log::LayoutAppender.

Reimplemented in Qmms::Log::FileAppender, and Qmms::Log::RollingFileAppender.


Member Data Documentation

bool Qmms::Log::StreamAppender::immediateFlush [protected]
 

Determines whether to flush immediately upon logging or to cache events until explicitly flushed.

This is set to true in the constructor so that subclasses needn't worry about it unless they wish to delay flushing of their output streams.

QFile Qmms::Log::StreamAppender::out [protected]
 

The "stream" to which to append LoggingEvents.

We use a QFile so that we may write to any of the standard streams.


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