-
Notifications
You must be signed in to change notification settings - Fork 57
Description
The Copper log is a linear log format built with sections:
|[Main header][Section1 header][Section1 data][Section2 header][Section2 data] ...|
In terms of structural metadata there are only 2 things that keeps it together:
1 is a Section length in the section header that allows the reader to jump from section to section.
2 there is a special header type that is added at the end to tell the log reader that this is the end of the log.
Also, but it is more minor, we also have a "used" field in the section header so if there is some padding at the end of the section we don't try to deserialize it.
With the application version of Copper, we do drop the unified logger on shutdown an it closes the log.
It is kind of inconvenient for the baremetal version because it would need a way with a stop button or something to ask Copper to stop.
Proposed solution: just write a phantom end of log section everytime we append a section at the end so at least the end of log is always marked + periodically update the section headers of the open sections.
This would work well for both the baremetal and regular app and would make the logs more robust after a crash or a power cut.