API
Collaboration diagram for The flatlogs log protocol:

Modules

 Type definitions for flatlogs.
 
 The flatlogs binary header definition
 
 Standard text formatting of logs for biological purposes
 
 Flatlogs_files
 

Detailed Description

flatlogs consist of a simple header, followed by a flatbuffers encoded message payload.

The log entry is a binary buffer with the following format:

                     1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
|p|evt|time_s |time_ns|l| [message (0-254)]
|p|evt|time_s |time_ns|E|len| [message (255-65534)]
|p|evt|time_s |time_ns|F|len          | [message (>65535)]

where the header consists of everything up to the [message]. Table notations are:

Rationale for variable length: this keeps the space used for 0 length and short messages to a minimum, while allowing for progressively larger messages to be saved.
The savings will be large for small messages, while the the cost is proportionally small for larger messages. For larger messages, this requires a progressive read to sniff out the entire length. Likewise, the cost is small relative to the cost of reading the larger message.

If a non-zero message exists, it is usually a flatlogs serialized buffer.