Detailed Design#
Log Detailed Design
|
status: draft
security: NO
safety: ASIL_B
|
||||
Detailed Design for Component: Log#
Description#
Log component consists of three units:
mw_log - modelled after log Rust library.
mw_log_fmt - replacement for core::fmt provided by Rust core library.
mw_log_macro - replacement for format_args macro provided by Rust compiler.
Most common approach in Rust is that formatting always results in a string. This means that the log library always receives a pre-formatted string.
Such approach is incompatible with the expectation that log sink is not always text-based. Log component design is no longer string-based, and data frames can consist of multiple types. Value is passed along with formatting options to the backend.
Rationale Behind Decomposition into Units#
All units provide an interface or an implementation to a well defined functionality. Those units are not described in architecture, as they all form a monolithic logging frontend.
Such frontend shall remain transparent replacement to common functionalities provided by Rust.
Static Diagrams for Unit Interactions#
Log class diagram
|
status: valid
security: NO
safety: ASIL_B
|
||||
|
|||||
Dynamic Diagrams for Unit Interactions#
Log operation
|
status: valid
security: NO
safety: ASIL_B
|
||||
|
|||||
Log to level
|
status: valid
security: NO
safety: ASIL_B
|
||||
|
|||||