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