Go to the documentation of this file.
29 #ifndef CASA_LOGSINK_H
30 #define CASA_LOGSINK_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Logging/LogSinkInterface.h>
35 #include <casacore/casa/Utilities/CountedPtr.h>
36 #include <casacore/casa/Exceptions/Error.h>
37 #include <casacore/casa/OS/Mutex.h>
38 #include <casacore/casa/iosfwd.h>
virtual Double getTime(uInt i) const
Get given part of the i-th message from the local sink.
static void postGloballyThenThrow(const LogMessage &message)
void preparePostThenThrow(const LogMessage &message, const AipsError &x)
Prepare for postThenThrow function.
void postThenThrow(const LogMessage &message, const EXC &exc)
Post message and then throw an AipsError exception containing message.toString().
static void createGlobalSink()
Create the global sink (attached to cerr).
Referenced counted pointer for constant data.
CountedPtr< LogSinkInterface > local_sink_p
Priority
An "importance" which is assigned to each LogMessage.
virtual uInt nelements() const
Get number of messages in local sink.
static CallOnce0 theirCallOnce
String id() const
Returns the id of the LogSink in use...
Abstract base class for filtering LogMessages.
virtual String getMessage(uInt i) const
static LogSinkInterface & globalSink()
Get/set the global sink or check if the global sink is null.
LogSink(LogMessage::Priority filter=LogMessage::NORMAL, Bool nullSink=True)
Create a null local sink that throws all messages away or create a memory local sink that holds the m...
static Bool postGlobally(const LogMessage &message)
Send message to the global sink only.
virtual void flush(Bool global=True)
Write any pending output (by default also the global sink).
virtual String getPriority(uInt i) const
Distribute LogMessages to their destination(s)
Informational log messages with with time, priority, and origin.
CountedPtr< LsiIntermediate > local_ref_to_global_p
The following is a reference to the global sink.
Bool post(const LogMessage &message)
Send message to both the local and global sink.
virtual void clearLocally()
Clear the local sink (i.e.
this file contains all the compiler specific defines
virtual String getObjectID(uInt i) const
static String localId()
Returns the id for this class...
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.
TableExprNode time(const TableExprNode &node)
static Bool nullGlobalSink()
virtual const LogFilterInterface & filter() const
Get or set the filter of this particular LogSink.
Accepts LogMessages and posts them to some destination.
const LogSinkInterface & localSink() const
Change the sink that this LogSink actually uses.
String: the storage and methods of handling collections of characters.
bool Bool
Define the standard types used by Casacore.
static CountedPtr< LsiIntermediate > * global_sink_p
virtual String getLocation(uInt i) const
LogSink & operator=(const LogSink &other)
Base class for all Casacore library errors.
Wrapper around std::call_once.
virtual Bool postLocally(const LogMessage &message)
Send message to the local sink only.