Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1345 Add sequence diagram for LogStrem logging
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed May 16, 2022
1 parent 2816ec6 commit 53be9c3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
44 changes: 44 additions & 0 deletions doc/design/diagrams/logging/logging_with_logstream.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@startuml

participant User
participant LogStream
participant "iox::log" as logFreeFunction << free function >>
participant Logger << static >>
participant "logger : DefaultLogger" as DefaultLogger

User -> LogStream ** : IOX_LOG(...)
activate LogStream
LogStream -> logFreeFunction ++ : getLogger
logFreeFunction -> Logger ++ : get <<private>>
Logger -> Logger ++ : activeLogger()
note right
activeLogger is only called
to initialize the thread local
logger pointer or when the
active flag of the logger is false
end note

Logger -> Logger : std::lock
Logger -> DefaultLogger **

return
return
return

LogStream -> DefaultLogger ++ : setupNewLogMessage
return

return

User -> LogStream ++ : << Hello World
LogStream -> DefaultLogger ++ : logString
return
return

User -> LogStream ++ : dTor via ; on temporary
LogStream -> DefaultLogger ++ : flush
return
return
destroy LogStream

@enduml
4 changes: 4 additions & 0 deletions doc/design/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ combination with the error handler.

![logging class diagram](../website/images/logging_classes.svg)

#### Logging with LogStream

![logging with logstream](../website/images/logging_with_logstream.svg)

#### Macro with lazy evaluation

The buildup of the log message is only done when the log level is above the output
Expand Down
1 change: 1 addition & 0 deletions doc/website/images/logging_with_logstream.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53be9c3

Please sign in to comment.