Logfile

The Logfile controls the how the simulation log is written to a file. This page explains See using logging for how to set up the logfile (e.g. give user-friendly names to the simulation objects). See analysing logs for R routines to read logs.

Writing records to a logfile

writeRecord(uint32_t type, uint32_t id, uint32_t ev, double val1, double val2, double val3);

Logfile format

The log file consts of two parts: a plain-text preamble, and a binary trace.

Preamble

The preamble consists of lines of plain text, separated by \n, in any order (except for the # TRACE line). The lines may be one of
object definition: objname=objidassociates a plain-text name objname with a numerical object id, as used in the trace
comment line# arbitrary text stringtypically used to describe the simulation setup
special comment line# numrecords=nnnspecifies the number of records in the trace that follows
special comment line# TRACEafter the \n, the binary part of the log file begins. This must be the last line of the preamble.

Trace

The trace consists of numrecords records, consisting of the fields
nametypemeaning
timedoubletimestamp [sec]
eventtypeunsigned 32-bit intclass of event
objidunsigned 32-bit intobject id that the event refers to
eventidXunsigned 32-bit intspecific event
val1doubleevent-specific log values
val2double
val3double
However, for convenience in reading in these fields, they are laid out transposed, i.e. double[numrecords] followed by unsigned 32-bit int[numrecords] etc. The meanings of these fields are given by logger implementations, except that eventidX is 100*eventtype+eventid