log4cplus  1.1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
log4cplus::ConsoleAppender Class Reference

ConsoleAppender appends log events to std::cout or std::cerr using a layout specified by the user. More...

#include <consoleappender.h>

Inheritance diagram for log4cplus::ConsoleAppender:
[legend]
Collaboration diagram for log4cplus::ConsoleAppender:
[legend]

List of all members.

Public Member Functions

 ConsoleAppender (bool logToStdErr=false, bool immediateFlush=false)
 ConsoleAppender (const log4cplus::helpers::Properties &properties)
 ~ConsoleAppender ()
virtual void close ()
 Release any resources allocated within the appender such as file handles, network connections, etc.

Static Public Member Functions

static
log4cplus::thread::Mutex const & 
getOutputMutex ()
 This mutex is used by ConsoleAppender and helpers::LogLog classes to synchronize output to console.

Protected Member Functions

virtual void append (const spi::InternalLoggingEvent &event)
 Subclasses of Appender should implement this method to perform actual logging.

Protected Attributes

bool logToStdErr
bool immediateFlush
 Immediate flush means that the underlying output stream will be flushed at the end of each append operation.

Detailed Description

ConsoleAppender appends log events to std::cout or std::cerr using a layout specified by the user.

The default target is std::cout.

Properties

logToStdErr

When it is set true, the output stream will be std::cerr instead of std::cout.

ImmediateFlush

When it is set true, output stream will be flushed after each appended event.

See also:
Appender

Definition at line 54 of file consoleappender.h.


Constructor & Destructor Documentation

log4cplus::ConsoleAppender::ConsoleAppender ( bool  logToStdErr = false,
bool  immediateFlush = false 
)

Member Function Documentation

virtual void log4cplus::ConsoleAppender::append ( const spi::InternalLoggingEvent event) [protected, virtual]

Subclasses of Appender should implement this method to perform actual logging.

See also:
doAppend method.

Implements log4cplus::Appender.

virtual void log4cplus::ConsoleAppender::close ( ) [virtual]

Release any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.

Implements log4cplus::Appender.

This mutex is used by ConsoleAppender and helpers::LogLog classes to synchronize output to console.


Member Data Documentation

Immediate flush means that the underlying output stream will be flushed at the end of each append operation.

Definition at line 79 of file consoleappender.h.

Definition at line 74 of file consoleappender.h.


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