refactor: Switch logging from log + env_logger to tracing + tracing_subscriber #298
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?
This switches the code base to tokio/tracing.
What
More specifically, this PR transforms the "rails" of logging from using log + event_logger to using tracing, and thereby opens the ability to open Spans or use the
#[instrument]
macro.It keeps full backward-compatibility with the prior logs as far as Rust is concerned.
Of course, this is not the hard part. The hard part is to use
tracing
wisely.What do we do now? (next steps)
Shave yaks!
Caveat
It may mess up the fabric benchmarking files, which I'm no longer sure we maintain. If it does, it would be because of different time printing formats, in particular it's a bit difficult to make tracing produce the wonky timestamps of log. As a consequence the python scripts may need massaging to handle RFC 3339 instead of ISO8601. I don't think it matters at this stage, but YMMV.