29 #ifndef TABLES_TABLELOGSINK_H
30 #define TABLES_TABLELOGSINK_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Logging/LogSink.h>
35 #include <casacore/casa/Logging/LogFilter.h>
36 #include <casacore/tables/Tables/Table.h>
37 #include <casacore/tables/Tables/ScalarColumn.h>
38 #include <casacore/tables/Tables/ArrayColumn.h>
39 #include <casacore/casa/Utilities/Assert.h>
40 #include <casacore/casa/Exceptions/Error.h>
Priority
An "importance" which is assigned to each LogMessage.
virtual const LogFilterInterface & filter() const
Get/set the filter.
Create a new table - define shapes, data managers, etc.
String: the storage and methods of handling collections of characters.
virtual void flush(Bool global=True)
Write out any pending output to the table.
TableLogSink(LogMessage::Priority filter, const String &fileName)
If fileName exists, attach and append to it, otherwise create a table with that name.
ScalarColumn< Double > time_p
const Table & table() const
Access to the actual log table and its columns.
const ScalarColumn< String > & roLocation() const
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.
ScalarColumn< String > & objectID()
void reopenRW(const LogFilterInterface &filter)
Reopen the logtable for read/write (if needed).
void init(const String &fileName)
Initialize the object.
virtual String getMessage(uInt i) const
ScalarColumn< String > id_p
ObjectID.
const ScalarColumn< String > & roObjectID() const
TableLogSink(const String &fileName)
Open the log table for readonly.
static TableDesc logTableDescription()
Description of the log table.
TableLogSink()
Undefined and inaccessible.
TableLogSink(const LogFilterInterface &filter, const String &fileName)
static String columnName(Columns which)
Turn the Columns enum into a String which is the actual column name in the Table.
ScalarColumn< String > & priority()
const ScalarColumn< Double > & roTime() const
const ScalarColumn< String > & roMessage() const
ScalarColumn< String > message_p
ScalarColumn< Double > & time()
ScalarColumn< String > location_p
Origin.
ScalarColumn< String > & location()
virtual Bool postLocally(const LogMessage &message)
If the message passes the filter, write it to the log table.
TableLogSink(const TableLogSink &other)
After copying, both sinks will write to the same Table.
Columns
Defines the minimal set of columns in the table (more may exist, but are ignored.
@ PRIORITY
Message importance.
@ OBJECT_ID
ObjectID of distributed object that created the message (String).
@ LOCATION
Source code origin of the log message.
@ MESSAGE
Informational message.
@ TIME
MJD in seconds, UT.
virtual String getLocation(uInt i) const
virtual uInt nelements() const
Get number of messages in sink.
virtual String getObjectID(uInt i) const
static LogSink makeSink(const LogFilterInterface &filter, const String &fileName)
static LogSink makeSink(const String &fileName)
Make a LogSink for a TableLogSink with a new table.
ScalarColumn< String > priority_p
ScalarColumn< String > & message()
static String localId()
Returns the id for this class...
virtual Double getTime(uInt i) const
Get given part of the i-th message from the sink.
String id() const
Returns the id of the LogSink in use...
void attachCols()
Attach the column objects and create unit keywor if needed.
void copy_other(const TableLogSink &other)
Avoid duplicating code in copy ctor and assignment operator.
const ScalarColumn< String > & roPriority() const
TableLogSink & operator=(const TableLogSink &other)
virtual String getPriority(uInt i) const
virtual void clearLocally()
Clear the local sink (i.e.
void makeTable(SetupNewTable &)
Make a new log table.
this file contains all the compiler specific defines
std::set< ScanKey > filter(const std::set< ScanKey > scans, const ArrayKey &arrayKey)
given a set of scan keys, return the subset that matches the given array key
bool Bool
Define the standard types used by Casacore.