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.
Per the logger documentation:
Personally, I feel that using a config file, which defaults to false to configure whether or not to listen to the environment for enabling and disabling logging is a bit dumb. Usually environment variables are meant to allow you to modify the configuration of a program for one "environment", not necessarily permanently. Especially when you get more complicated environment filtering.
For me, I'm content with
Info
or evenDebug
as the default, but will occasionally bump the log level to tracing for specific sessions. That's not something I want to make a permanent change, so I execute the program asRUST_LOG=tracing cargo run
instead of having to go into a file and modify it, then undo the change later. The fact that you can't do this by default is counter-intuitive.Although I'm sure there are better sources for it, I personally believe that this stackoverflow sums up my experience and feelings around precedence
Additionally, I'd like to use this as a springboard to advocate for a few things, primarily introducing the idea of migrating away from
log
totracing
, as there's a lot more that can be done with regards to performance measuring and testing.