Rust Bridge Detailed Design#
Description#
The rust log bridge component consists of five units:
score_log- modelled afterlogRust library.score_log_fmt- replacement forcore::fmtprovided by Rust core library.score_log_fmt_macro- replacement for macros provided by Rust compiler: -score_log_format_args!- replacement forformat_args!-ScoreDebug- replacement forDebugstdout_logger- string-based backend forscore_log, data is written to a fixed-size buffer.stdout_logger_cpp_init- C++ builder and C interface to set up thestdout_loggerfrom C++ applications.
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
|
||||
|
|||||