log4cpp  1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
log4cpp::OstreamAppender Class Reference

OstreamAppender appends LoggingEvents to ostreams. More...

#include <OstreamAppender.hh>

Inheritance diagram for log4cpp::OstreamAppender:
log4cpp::LayoutAppender log4cpp::AppenderSkeleton log4cpp::Appender

Public Member Functions

 OstreamAppender (const std::string &name, std::ostream *stream)
 
virtual ~OstreamAppender ()
 
virtual bool reopen ()
 Reopens the output destination of this Appender, e.g. More...
 
virtual void close ()
 Release any resources allocated within the appender such as file handles, network connections, etc. More...
 
- Public Member Functions inherited from log4cpp::LayoutAppender
 LayoutAppender (const std::string &name)
 
virtual ~LayoutAppender ()
 
virtual bool requiresLayout () const
 Check if the appender requires a layout. More...
 
virtual void setLayout (Layout *layout=NULL)
 Set the Layout for this appender. More...
 
- Public Member Functions inherited from log4cpp::AppenderSkeleton
virtual ~AppenderSkeleton ()
 Destructor for AppenderSkeleton. More...
 
virtual void doAppend (const LoggingEvent &event)
 Log in Appender specific way. More...
 
virtual void setThreshold (Priority::Value priority)
 Set the threshold priority of this Appender. More...
 
virtual Priority::Value getThreshold ()
 Get the threshold priority of this Appender. More...
 
virtual void setFilter (Filter *filter)
 Set a Filter for this appender. More...
 
virtual FiltergetFilter ()
 Get the Filter for this appender. More...
 
- Public Member Functions inherited from log4cpp::Appender
virtual ~Appender ()
 Destructor for Appender. More...
 
const std::string & getName () const
 Get the name of this appender. More...
 

Protected Member Functions

virtual void _append (const LoggingEvent &event)
 Log in Appender specific way. More...
 
- Protected Member Functions inherited from log4cpp::LayoutAppender
Layout_getLayout ()
 Return the layout of the appender. More...
 
- Protected Member Functions inherited from log4cpp::AppenderSkeleton
 AppenderSkeleton (const std::string &name)
 Constructor for AppenderSkeleton. More...
 
- Protected Member Functions inherited from log4cpp::Appender
 Appender (const std::string &name)
 Constructor for Appender. More...
 

Protected Attributes

std::ostream * _stream
 

Additional Inherited Members

- Public Types inherited from log4cpp::LayoutAppender
typedef BasicLayout DefaultLayoutType
 
- Static Public Member Functions inherited from log4cpp::Appender
static AppendergetAppender (const std::string &name)
 Get a pointer to an exitsing Appender. More...
 
static bool reopenAll ()
 Call reopen() on all existing Appenders. More...
 
static void closeAll ()
 Call reopen() on all existing Appenders. More...
 

Detailed Description

OstreamAppender appends LoggingEvents to ostreams.

Constructor & Destructor Documentation

log4cpp::OstreamAppender::OstreamAppender ( const std::string &  name,
std::ostream *  stream 
)
log4cpp::OstreamAppender::~OstreamAppender ( )
virtual

Member Function Documentation

void log4cpp::OstreamAppender::_append ( const LoggingEvent event)
protectedvirtual

Log in Appender specific way.

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

Parameters
eventThe LoggingEvent to log.

Implements log4cpp::AppenderSkeleton.

void log4cpp::OstreamAppender::close ( )
virtual

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

Implements log4cpp::AppenderSkeleton.

bool log4cpp::OstreamAppender::reopen ( )
virtual

Reopens the output destination of this Appender, e.g.

the logfile or TCP socket.

Returns
false if an error occured during reopening, true otherwise.

Reimplemented from log4cpp::AppenderSkeleton.

Member Data Documentation

std::ostream* log4cpp::OstreamAppender::_stream
protected

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