Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.png
19 changes: 19 additions & 0 deletions design/circular_buffer_allocator_acquireslottowrite.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@startuml circular_buffer_allocator_acquireslottowrite
title Circular Buffer Allocator Acquire Slot To Write
start
:Loop Counter = 0;
repeat :Increment loop counter;
:Atomically
Get slot
Increment next slot index;
:Slot index = claimed slot % circular buffer capacity;
if (Loop counter > circular buffer size) then (Yes)
:Return empty;
stop
else (No)
endif
repeat while (Slot in use?) is (Yes) not (No);
:Mark Slot as in use;
:Return Slot index;
stop
@enduml
15 changes: 0 additions & 15 deletions design/circular_buffer_allocator_acquireslottowrite.uxf

This file was deleted.

113 changes: 113 additions & 0 deletions design/configuration_sequence.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
@startuml configuration_sequence
title Configuration Sequence

participant "App" as App
participant "Logger" as LOG
participant "LogStreamFactory" as LSF
participant "Runtime" as RT
participant "RecorderFactory" as RF
participant "TargetConfigReader" as TCR
participant "ConfigurationFileDiscoverer" as CFD
participant "JSON" as JSON
participant "OS" as OS

activate App

App -> LOG **: CreateLogger(...)
activate LOG

App -> LOG: LogError()

LOG -> LSF: GetStream(LogLevel)

LSF -> RT: GetRecorder()

alt Runtime instance has not been created
RT -> RT: Constructor
activate RT
end

RT -> RF **: CreateRecorderFactory()

activate RF

RT -> RF: CreateFromConfiguration()


RF -> CFD **: make_unique<ConfigurationFileDiscoverer>(...)
activate CFD

RF -> TCR **: make_unique<TargetConfigReader>(ConfigurationFileDiscoverer)
activate TCR


RF -> TCR: ReadConfig()

TCR -> CFD: FindConfigurationFiles()

note right of CFD
Find and return the existing
config files.
end note

CFD -> OS: access(/etc/ecu_logging_config.json)
alt MW_LOG_CONFIG_FILE is defined
CFD -> OS: access(MW_LOG_CONFIG_FILE)
else MW_LOG_CONFIG_FILE is undefined
CFD -> OS: access(<cwd>/etc/logging.json)
CFD -> OS: access(<cwd>/logging.json)
CFD -> OS: access(<binary path>/../etc/logging.json)
end

CFD -> TCR: Return global and environmental or application config file paths.

TCR -> JSON: FromFile(global_file_path)
JSON -> TCR:

alt MW_LOG_CONFIG_FILE is defined
TCR -> JSON: FromFile(<environmental file path>)
JSON -> TCR:
else MW_LOG_CONFIG_FILE is undefined
TCR -> JSON: FromFile(<app_file_path>)
JSON -> TCR:
end

note right of TCR
Overwrite global configiuration
with environmental or application config file paths.
end note

TCR -> RF: Return Configuration instance

group Possibilities

note right of RF
For exmple, kRemote and kConsole
requested in configuration.
end note

Create "DatarouterRecorder" as DR

RF -> DR: Create instance with configuration

Create "TextRecorder" as TR

RF -> TR: Create instance with configuration

Create "CompositeRecorder" as CR

RF -> CR: Create with Datarouter and StandardOut recorders
note right of CR
Composite Recorder will
forward the logs to DatarouterRecorder
and TextRecorder
end note

end

RF -> RT: Store returned instance

RT -> LSF
LSF -> LOG: Return Recorder instance

@enduml
Loading