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

Name / parent form of event!() macro doesn't compile #2984

Open
Mododo opened this issue May 27, 2024 · 0 comments
Open

Name / parent form of event!() macro doesn't compile #2984

Mododo opened this issue May 27, 2024 · 0 comments

Comments

@Mododo
Copy link

Mododo commented May 27, 2024

Bug Report

Version

tracing 0.1.40

Platform

Fedora Linux 40, all affected

Crates

tracing

Description

I'm unable to use this form of event!() macro:

let span = tracing::info_span!("parent");
tracing::event!(name: "name", parent: &span, tracing::Level::ERROR, "foo");

and its variants (debug!(), etc) due to error

error[E0599]: no method named `is_enabled` found for struct `DefaultCallsite` in the current scope
    |
    |         tracing::event!(name: "name", parent: &span, tracing::Level::ERROR, "foo");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `DefaultCallsite`
    |
    = note: this error originates in the macro `$crate::event` which comes from the expansion of the macro `tracing::event` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile ...

Looks like it was missed out by accident.
Pull request with fix: #2983

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

No branches or pull requests

1 participant