Skip to content
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

Merged
merged 1 commit into from
Feb 17, 2021
Merged

Fix logging macros #1239

merged 1 commit into from
Feb 17, 2021

Conversation

bkchr
Copy link
Contributor

@bkchr bkchr commented Feb 16, 2021

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.

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.
@bkchr bkchr requested review from davidbarsky, hawkw and a team as code owners February 16, 2021 14:21
Copy link
Member

@hawkw hawkw left a 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!

@bkchr
Copy link
Contributor Author

bkchr commented Feb 17, 2021

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?

Yeah the tests did not compile before :)

@hawkw hawkw merged commit 1b800fa into tokio-rs:master Feb 17, 2021
@bkchr bkchr deleted the bkchr-fix-macros branch February 17, 2021 18:07
@bkchr
Copy link
Contributor Author

bkchr commented Feb 17, 2021

@hawkw ty for merging. For backporting I need to open another pr against the 0.1 branch?

@hawkw
Copy link
Member

hawkw commented Feb 17, 2021

@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 v0.1.x, git cherry-pick the commit that merged this to master, and open a PR against v0.1.x, if you'd like to do it yourself.

@bkchr
Copy link
Contributor Author

bkchr commented Feb 17, 2021

Ahh nice :) If you wanted to do this anyway, I will not do it :) Ty for the fast answer :)

hawkw pushed a commit that referenced this pull request Feb 17, 2021
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.
hawkw added a commit that referenced this pull request Feb 17, 2021
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>
hawkw added a commit that referenced this pull request Feb 17, 2021
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>
hawkw added a commit that referenced this pull request Feb 17, 2021
### 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>
@hawkw
Copy link
Member

hawkw commented Feb 17, 2021

Okay, just published tracing 0.1.24 including this fix, thanks again!

kaffarell pushed a commit to kaffarell/tracing that referenced this pull request May 22, 2024
### 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants