-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logging macros #1239
Fix logging macros #1239
Conversation
This pr fixes the logging macros to accept syntax like `info!(target: "test", ?value)`. While this works without the explicit `target`, it did not worked with the `target` up to now. Besides that the macros also used from wrong levels in certain branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, and for adding tests! This looks great to me — I'm guessing that the new test cases don't compile before this change?
It might also be nice to have tests that catch incorrect levels, but that would require adding new tests that actually invoke an event macro and expect a certain event to be emitted, in tracing/tests/event.rs
. That's not really a blocker, though — the compile tests are great, and I'll happily merge the fix in either case!
Yeah the tests did not compile before :) |
@hawkw ty for merging. For backporting I need to open another pr against the 0.1 branch? |
I was about to open a PR to backport this, but yeah, that's correct. The backport process is to branch from |
Ahh nice :) If you wanted to do this anyway, I will not do it :) Ty for the fast answer :) |
This PR fixes the event macros to accept syntax like `info!(target: "test", ?value)`. While this works without the explicit `target`, it did not worked with the `target` up to now. Besides that the macros also used from wrong levels in certain branches.
This PR fixes the event macros to accept syntax like `info!(target: "test", ?value)`. While this works without the explicit `target`, it did not worked with the `target` up to now. Besides that the macros also used from wrong levels in certain branches. Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Fixed - **attributes**: Compiler error when using `#[instrument(err)]` on functions which return `impl Trait` ([#1236]) - Fixed broken match arms in event macros ([#1239]) - Documentation improvements ([#1232]) Thanks to @bkchr and @lfranke for contributing to this release! [#1236]: #1236 [#1239]: #1239 [#1232]: #1232 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
### Fixed - **attributes**: Compiler error when using `#[instrument(err)]` on functions which return `impl Trait` ([#1236]) - Fixed broken match arms in event macros ([#1239]) - Documentation improvements ([#1232]) Thanks to @bkchr and @lfranke for contributing to this release! [#1236]: #1236 [#1239]: #1239 [#1232]: #1232 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Okay, just published |
### Fixed - **attributes**: Compiler error when using `#[instrument(err)]` on functions which return `impl Trait` ([tokio-rs#1236]) - Fixed broken match arms in event macros ([tokio-rs#1239]) - Documentation improvements ([tokio-rs#1232]) Thanks to @bkchr and @lfranke for contributing to this release! [tokio-rs#1236]: tokio-rs#1236 [tokio-rs#1239]: tokio-rs#1239 [tokio-rs#1232]: tokio-rs#1232 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This pr fixes the logging macros to accept syntax like
info!(target: "test", ?value)
. While this works without the explicittarget
, it did not worked with thetarget
up to now. Besides thatthe macros also used from wrong levels in certain branches.