On the assumption that log messages will be sent between the process and the user interface fairly often, the memory use of the current process tags along in the record.
The posted Glish event is named log and is a record with the following format:
Field (type) |
Contents |
nessage (string) |
The posted message. |
time_mjd (double) |
The time the message was created, MJD in days. Does not take into account the timezone. |
time_string (string) |
Formatted version of the time, including the timezone. |
location (string) |
Source code origin of the message. May contain all of function, file, and line number. Does not contain the ObjectID. |
id (record) |
ObjectID of the message originator, in the record format defined by ObjectID::toRecord(). |
_memory (double) |
Memory use of this process, in MB. |
In general, you do not need to set up GlishLogSink yourself, the Tasking system will use it for you. However if you have a nonstandard client from which you wish to post log messages in the standard format on the Glish bus, you merely have to replace the global sink with a GlishLogSink.
int main(int argc, char **argv) { CountedPtr<GlishSysEventSource> ptr(new GlishSysEventSource(argc, argv)); LogFilter defaultFilter; LogSinkInterface *newGlobal = new GlishLogSink(defaultFilter, ptr); LogSink::globalSink(newGlobal); ... LogIO io; io << "Every good boy deserves fudge" << LogIO::POST; // goes to Glish! ...
Reference semantics, i.e. after copying posted messages to either GlishLogSink will be posted to the same Glish bus.
Post the message to the glish bus if we are connected to Glish, otherwise post the message to cerr.
Returns the id for this class...