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/iosfwd.h>
Referenced counted pointer for constant data.
Priority
An "importance" which is assigned to each LogMessage.
String id() const
Returns the id of the LogSink in use...
LogSink(const LogFilterInterface &filter, ostream *os, Bool useGlobalSink=True)
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.
virtual String getLocation(uInt i) const
LogSink(const LogFilterInterface &filter, const String &fileName, Int n=0)
Temporary to avoid problem that the bool constructor is taken if a char* is passed.
LogSink(LogMessage::Priority, const Char *fileName, Int n=0)
LogSink(const LogFilterInterface &filter, const Char *fileName, Int n=0)
virtual LogSinkInterface & filter(const LogFilterInterface &filter)
CountedPtr< LsiIntermediate > local_ref_to_global_p
The following is a reference to the global sink.
virtual String getMessage(uInt i) const
virtual Bool postLocally(const LogMessage &message)
Send message to the local sink only.
virtual const LogFilterInterface & filter() const
Get or set the filter of this particular LogSink.
LogSinkInterface & localSink()
LogSink(LogMessage::Priority filter, ostream *os, Bool useGlobalSink=True)
Log to an ostream.
virtual void clearLocally()
Clear the local sink (i.e.
virtual Double getTime(uInt i) const
Get given part of the i-th message from the local sink.
LogSink(const LogSink &other)
Make a referencing copy of other.
void postThenThrow(const LogMessage &message, const EXC &exc)
Post message and then throw an AipsError exception containing message.toString().
LogSink(const LogFilterInterface &filter, Bool nullSink=True)
CountedPtr< LogSinkInterface > local_sink_p
LogSink & operator=(const LogSink &other)
LogSink(LogMessage::Priority, const String &fileName, Int n=0)
static Bool postGlobally(const LogMessage &message)
Send message to the global sink only.
static LogSinkInterface & globalSink()
Get/set the global sink or check if the global sink is null.
virtual uInt nelements() const
Get number of messages in local sink.
LogSink & localSink(LogSinkInterface *&fromNew)
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 nullGlobalSink()
static CountedPtr< LsiIntermediate > * global_sink_p
static void postGloballyThenThrow(const LogMessage &message)
Bool post(const LogMessage &message)
Send message to both the local and global sink.
virtual String getObjectID(uInt i) const
static void createGlobalSink()
Create the global sink (attached to cerr).
const LogSinkInterface & localSink() const
Change the sink that this LogSink actually uses.
LogSink(const LogFilterInterface &filter, const CountedPtr< LogSinkInterface > &)
Log to the given sink.
virtual String getPriority(uInt i) const
static String localId()
Returns the id for this class...
virtual void flush(Bool global=True)
Write any pending output (by default also the global sink).
static std::once_flag theirCallOnceFlag
static void globalSink(LogSinkInterface *&fromNew)
void preparePostThenThrow(const LogMessage &message, const AipsError &x)
Prepare for postThenThrow function.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
TableExprNode time(const TableExprNode &node)
bool Bool
Define the standard types used by Casacore.