casa
$Rev:20696$
|
Send log messages to an ostream. More...
#include <StreamLogSink.h>
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 . | |
StreamLogSink & | operator= (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 |
Send log messages to an ostream.
Internal
"Stream" from the family of standard C++ I/O classes.
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 .
See (see (file="Logging.h"))Logging.h .
Writing to standard output or error will be a common way of displaying log messages.
Definition at line 80 of file StreamLogSink.h.
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] |
casa::StreamLogSink::StreamLogSink | ( | const StreamLogSink & | other | ) |
Make a copy of other
.
After copying, both objects will post to the same stream.
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.
bool casa::StreamLogSink::deleteStream [private] |
Definition at line 117 of file StreamLogSink.h.
ostream* casa::StreamLogSink::stream_p [private] |
Definition at line 116 of file StreamLogSink.h.