casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Attributes
casa::StreamLogSink Class Reference

Send log messages to an ostream. More...

#include <StreamLogSink.h>

Inheritance diagram for casa::StreamLogSink:
casa::LogSinkInterface

List of all members.

Public Member Functions

 StreamLogSink (ostream *theStream=0, bool deleteStream=false)
 Defaults to cerr if no stream is supplied.
 StreamLogSink (LogMessage::Priority filter, ostream *theStream=0, bool deleteStream=false)
 StreamLogSink (const LogFilterInterface &filter, ostream *theStream=0, bool deleteStream=false)
 StreamLogSink (const StreamLogSink &other)
 Make a copy of other.
StreamLogSinkoperator= (const StreamLogSink &other)
 ~StreamLogSink ()
 
     

virtual Bool postLocally (const LogMessage &message)
 Write message to the stream if it passes the filter.
virtual void flush (Bool global=True)
 write any pending output.
String id () const
 Returns the id of the LogSink in use...

Static Public Member Functions

static String localId ()
 Returns the id for this class...

Private Attributes

ostream * stream_p
bool deleteStream

Detailed Description

Send log messages to an ostream.

Intended use:

Internal

Review Status

Reviewed By:
wbrouw
Date Reviewed:
1996/08/21
Test programs:
tLogging
Demo programs:
dLogging

Prerequisite

Etymology

"Stream" from the family of standard C++ I/O classes.

Synopsis

StreamLogSink is a straightforward LogSinkInterface which sends its messages to an ostream (typically cerr) which it is given at construction time. It is not intended to be used directly, rather it should be used through LogSink .

Example

See (see (file="Logging.h"))Logging.h .

Motivation

Writing to standard output or error will be a common way of displaying log messages.

To Do

Definition at line 80 of file StreamLogSink.h.


Constructor & Destructor Documentation

casa::StreamLogSink::StreamLogSink ( ostream *  theStream = 0,
bool  deleteStream = false 
) [explicit]

Defaults to cerr if no stream is supplied.

The caller is responsible for ensuring that the supplied ostream ostream lives at least as long as this sink. If not filter is supplied, NORMAL is used.

casa::StreamLogSink::StreamLogSink ( LogMessage::Priority  filter,
ostream *  theStream = 0,
bool  deleteStream = false 
) [explicit]
casa::StreamLogSink::StreamLogSink ( const LogFilterInterface filter,
ostream *  theStream = 0,
bool  deleteStream = false 
) [explicit]

Make a copy of other.

After copying, both objects will post to the same stream.

     


Member Function Documentation

virtual void casa::StreamLogSink::flush ( Bool  global = True) [virtual]

write any pending output.

Reimplemented from casa::LogSinkInterface.

String casa::StreamLogSink::id ( ) const [virtual]

Returns the id of the LogSink in use...

Implements casa::LogSinkInterface.

static String casa::StreamLogSink::localId ( ) [static]

Returns the id for this class...

Reimplemented from casa::LogSinkInterface.

StreamLogSink& casa::StreamLogSink::operator= ( const StreamLogSink other)
virtual Bool casa::StreamLogSink::postLocally ( const LogMessage message) [virtual]

Write message to the stream if it passes the filter.

Works by calling operator<<(ostream &,const LogMesssage&).

Implements casa::LogSinkInterface.


Member Data Documentation

Definition at line 117 of file StreamLogSink.h.

ostream* casa::StreamLogSink::stream_p [private]

Definition at line 116 of file StreamLogSink.h.


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