RustFest2024 - Logging improvements suggestions #1079
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why? What?
This draft PR contains suggestions on logging improvements discussed with the HULK team during RustFest 2024 in Zurich. It is supposed to serve as an inspiration for using logging in the hulk codebase.
We discussed two possible approaches:
Improve general logging
Current logging using
fern
crate could be enhanced by:target
attribute and name of the crate (see changes in thepath_planner.rs
)setup_logger
function)Use logging for tracing asynchronous communication
The idea is to use crate
tracing
for emitting log spans on one side and creating subscribers to these log on the other side.For this you need to:
tools/fanta/src/main.rs
)path_planner.rs
)Sources
Fern setup: example
Tracing used in Tokio: page
Possible next steps:
Create custom subscribers for a particular purpose: documentation
Use
tokio-console
for more logging, integrate with telemetry: documentation