fix(logging): add startup and shutdown lifecycle events#2359
Conversation
| if self.genesis_block_file.is_some() { "file" } else { "network" }, | ||
| genesis.source = %self.genesis_block_file.as_ref().map_or_else( | ||
| || self.network.map_or_else( | ||
| || "unknown".to_owned(), |
There was a problem hiding this comment.
nit: "undefined" or "custom" instead of "unknown"? Not important
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
I'm unsure how I feel about this tbh. It achieves the goal, but I think we're wading into the territory of the telemetry and logging overshadowing the actual code that I want to see.
Or put differently, I want the majority of the LoC in a function to be actual logic. Not logging or helper functions for it.
Some of this is dictated by instrument! scoping for field recordings, but I feel this is going to be a problem no matter what given tracing API.
We can go ahead; I don't have a better solution.
| tracing::info!( | ||
| target: crate::LOG_TARGET, | ||
| { | ||
| genesis.commitment = %genesis_commitment, | ||
| data.directory = %self.data_directory.display(), | ||
| }, | ||
| "Node bootstrap complete", | ||
| ); |
There was a problem hiding this comment.
I wonder if it would be beneficial to create our own macro; given that we don't want the full tracing feature set.
If we re-arrange the macro order, we can put the fields at the end and remove the need for { } encapsulation?
Summary
Partially resolves part 5 of issue #2330
Changelog