LRAUV  revA
Binary Data Storage and Logging

Logging is primarily done behind the scenes, by using DataReader and DataWriter objects within a component.

Both data reads and data writes can be logged, although in the current implementation, only data writes are logged. During a computation cycle, data writes are buffered (as LogEntry instances) in a LogQueue. At the end of the cycle, all the accumulated LogEntry instances are serialized to the log and are then released. There can be zero or more LogWriter instances for any LogEntry – a set of LogRule instances can be used to define what LogWriter is used for each LogEntry.

There are three "flavors" of LogEntry: EventEntry, DataEntry, and SyslogEntry

EventEntry

An EventEntry is serialized as:

DataEntry

A DataEntry is serialized as:

SyslogEntry

A SyslogEntry is serialized as:

  • a 16-bit header (serialized using OutStream::writeUShortCompact) including:
    • 12 high bits: Actor code (which can be used to look up what code unit is writing to the log)
    • 2 bits: Syslog::Severity code, indicating the severity of the message being logged: from debug messages to messages that must be relayed to shore via satellite.
    • 2 bits: the value 2, indicating this is a SyslogEntry
  • 64-bit Timespan as integer microseconds since the previous LogEntry, serialized using OutStream::writeLongLongCompact.
  • 16-bit integer length of the character sequence that follows, serialized using OutStream::writeUShortCompact
  • the characters of the message, with no termination character.