Go to the documentation of this file.
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>
Define the structure of a Casacore table.
TableLogSink(LogMessage::Priority filter, const String &fileName)
If fileName exists, attach and append to it, otherwise create a table with that name.
const ScalarColumn< Double > & roTime() 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.
TableLogSink & operator=(const TableLogSink &other)
@ MESSAGE
Informational message.
virtual String getObjectID(uInt i) const
static String columnName(Columns which)
Turn the Columns enum into a String which is the actual column name in the Table.
@ TIME
MJD in seconds, UT.
void init(const String &fileName)
Initialize the object.
const ScalarColumn< String > & roLocation() const
void makeTable(SetupNewTable &)
Make a new log table.
ScalarColumn< Double > time_p
const ScalarColumn< String > & roObjectID() const
ScalarColumn< String > message_p
virtual Bool postLocally(const LogMessage &message)
If the message passes the filter, write it to the log table.
virtual uInt nelements() const
Get number of messages in sink.
Priority
An "importance" which is assigned to each LogMessage.
virtual String getPriority(uInt i) const
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
Abstract base class for filtering LogMessages.
virtual String getMessage(uInt i) const
void copy_other(const TableLogSink &other)
Avoid duplicating code in copy ctor and assignment operator.
String id() const
Returns the id of the LogSink in use...
TableLogSink(const LogFilterInterface &filter, const String &fileName)
Main interface class to a read/write table.
const Table & table() const
Access to the actual log table and its columns.
ScalarColumn< String > & objectID()
Columns
Defines the minimal set of columns in the table (more may exist, but are ignored.
TableLogSink(const String &fileName)
Open the log table for readonly.
@ PRIORITY
Message importance.
virtual Double getTime(uInt i) const
Get given part of the i-th message from the sink.
ScalarColumn< String > & message()
Save log messages in a Casacore Table.
ScalarColumn< String > priority_p
Distribute LogMessages to their destination(s)
Informational log messages with with time, priority, and origin.
virtual void flush(Bool global=True)
Write out any pending output to the table.
void attachCols()
Attach the column objects and create unit keywor if needed.
static String localId()
Returns the id for this class...
Filter LogMessages on message priority.
Create a new table - define shapes, data managers, etc.
TableLogSink()
Undefined and inaccessible.
ScalarColumn< String > & location()
static TableDesc logTableDescription()
Description of the log table.
this file contains all the compiler specific defines
static LogSink makeSink(const String &fileName)
Make a LogSink for a TableLogSink with a new table.
void reopenRW(const LogFilterInterface &filter)
Reopen the logtable for read/write (if needed).
ScalarColumn< String > location_p
Origin.
TableLogSink(const TableLogSink &other)
After copying, both sinks will write to the same Table.
const ScalarColumn< String > & roMessage() const
@ LOCATION
Source code origin of the log message.
virtual void clearLocally()
Clear the local sink (i.e.
Accepts LogMessages and posts them to some destination.
@ OBJECT_ID
ObjectID of distributed object that created the message (String).
String: the storage and methods of handling collections of characters.
bool Bool
Define the standard types used by Casacore.
virtual const LogFilterInterface & filter() const
Get/set the filter.
ScalarColumn< Double > & time()
virtual String getLocation(uInt i) const
ScalarColumn< String > id_p
ObjectID.
const ScalarColumn< String > & roPriority() const
ScalarColumn< String > & priority()
static LogSink makeSink(const LogFilterInterface &filter, const String &fileName)