tracing
tracing copied to clipboard
attributes: remove default level for instrument attribute macro
This PR removes the default level for the #[instrument] attribute macro, forcing the user to explicitly specify the logging level.
Fixes #1070
Motivation
As mentioned in the associated issue, the default value of the tracing level might have performance and users should be aware of the tracing level they are opting for the performance impact it can have. Whatever default we pick might not work for some and might surprise some people. Making the level explicit allows users to make a conscious choice.
Solution
This PR adds a complie_error in case no tracing level is specified by the user.
I have made most of the documentation and test changes required. Please let me know if I missed some.
Is this still something we want to merge @hawkw ?
@bryangarza it looks like a large number of merge conflicts need to be resolved.
Thanks, yeah I wasn’t sure if it was still a change we wanted. Sounds good!
Since this is going to start introducing compile errors, I set the tracing-attributes 0.2 milestone.
We'll also need to fix the merge conflicts at some point.
Since this is going to start introducing compile errors, I set the
tracing-attributes 0.2milestone.
That's correct, this should be merged to the master branch for v0.2, as it's a breaking change. Thus far, I've put it off because actually merging the breaking change will make backporting more annoying.