casacore
|
#include <LogSinkInterface.h>
Public Member Functions | |
LogSinkInterface () | |
Create with a NORMAL filter. More... | |
LogSinkInterface (const LogFilterInterface &filter) | |
Create with the supplied filter . More... | |
LogSinkInterface (const LogSinkInterface &other) | |
Copy semantics - copy the filter from other to this More... | |
LogSinkInterface & | operator= (const LogSinkInterface &) |
virtual | ~LogSinkInterface () |
virtual const LogFilterInterface & | filter () const |
Get/set the filter. More... | |
virtual LogSinkInterface & | filter (const LogFilterInterface &filter) |
virtual uInt | nelements () const |
Get number of messages in sink. More... | |
virtual Double | getTime (uInt i) const |
Get given part of the i-th message from the sink. More... | |
virtual String | getPriority (uInt i) const |
virtual String | getMessage (uInt i) const |
virtual String | getLocation (uInt i) const |
virtual String | getObjectID (uInt i) const |
virtual Bool | postLocally (const LogMessage &message)=0 |
This function must be over-ridden in derived classes. More... | |
virtual void | flush (Bool global=True) |
Write any pending output. More... | |
virtual void | writeLocally (Double time, const String &message, const String &priority, const String &location, const String &objectID) |
Write a message (usually from another logsink) into the local one. More... | |
virtual void | clearLocally () |
Clear the local sink (i.e. More... | |
virtual String | id () const =0 |
Returns the id of the LogSink in use... More... | |
virtual void | cerrToo (bool cerr2) |
Write to cerr too. More... | |
void | setTaskName (const String &theTask) |
Static Public Member Functions | |
static String | localId () |
Returns the id for this class... More... | |
Protected Attributes | |
String | taskName |
Private Attributes | |
LogFilterInterface * | filter_p |
Accepts LogMessages and posts them to some destination
Internal
Log as in "Log Book." Sink from its common usage ("source/sink") as a thing which can accept some substance or energy. Interface because this is an abstract, not concrete, class.
This abstract base class is not intended for applications programmers. Instead they should look at LogSink.
This class defines a minimal "posting" interface for all objects which accept log messages. The fundamental model of a LogSinkInterface
is:
There is no notion of local vs global sinks - that is imposed by LogSink
.
For a more complete example see (see (file="Logging.h"))Logging.h.
Make it straightforward to extend the number of places a message may be in the future through derivation.
Definition at line 99 of file LogSinkInterface.h.
casacore::LogSinkInterface::LogSinkInterface | ( | ) |
Create with a NORMAL
filter.
casacore::LogSinkInterface::LogSinkInterface | ( | const LogFilterInterface & | filter | ) |
Create with the supplied filter
.
casacore::LogSinkInterface::LogSinkInterface | ( | const LogSinkInterface & | other | ) |
Copy semantics - copy the filter from other
to this
|
virtual |
|
virtual |
Write to cerr too.
|
virtual |
Clear the local sink (i.e.
remove all messages from it). The default implementation does nothing.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
|
virtual |
Get/set the filter.
Reimplemented in casacore::LogSink.
Referenced by casacore::TableLogSink::makeSink().
|
virtual |
Reimplemented in casacore::LogSink.
Write any pending output.
Reimplemented in casacore::TableLogSink, casacore::StreamLogSink, and casacore::LogSink.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
Get given part of the i-th message from the sink.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
|
pure virtual |
Returns the id of the LogSink in use...
Implemented in casacore::TableLogSink, casacore::StreamLogSink, casacore::NullLogSink, casacore::MemoryLogSink, and casacore::LogSink.
|
static |
Returns the id for this class...
|
virtual |
Get number of messages in sink.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
LogSinkInterface& casacore::LogSinkInterface::operator= | ( | const LogSinkInterface & | ) |
|
pure virtual |
This function must be over-ridden in derived classes.
If the filter passes the message, do what is necessary with the message and return True
.
Implemented in casacore::TableLogSink, casacore::StreamLogSink, casacore::NullLogSink, casacore::MemoryLogSink, and casacore::LogSink.
|
inline |
Definition at line 157 of file LogSinkInterface.h.
References taskName.
|
virtual |
Write a message (usually from another logsink) into the local one.
The default implementation does nothing.
Reimplemented in casacore::TableLogSink, casacore::MemoryLogSink, and casacore::LogSink.
|
private |
Definition at line 159 of file LogSinkInterface.h.
|
protected |
Definition at line 161 of file LogSinkInterface.h.
Referenced by setTaskName().