Skip to content

Conversation

@Mododo
Copy link
Contributor

@Mododo Mododo commented May 27, 2024

I'm on tracing v0.1.40 and cannot use macro

tracing::event!(name: "name", parent: &span, Level::ERROR, "foo")

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

no method named `is_enabled` found for struct `DefaultCallsite` in the current scope

Looks like it was just missed out by accident

Copy link
Contributor

@kaffarell kaffarell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Maybe add this trailer to the commit:

Fixes: 45a5df13735e ("core: add a limited form of the linked-list callsite registry for v0.1.x (#2083)")

@bdolgov
Copy link

bdolgov commented Apr 27, 2025

Friendly ping: can this be merged in?

@jplatte
Copy link
Member

jplatte commented May 30, 2025

Wdyt @hds? This targets the v0.1.x branch, though maybe because it's only relevant for that? May want to cherry-pick onto your backport branch?

In the case of an event with a name and a parent, the change in tokio-rs#2083
to use a free function instead of a method for `is_enabled` was not
applied. This particular variant was also not covered by any tests,
which is how this error slipped through CI.

This change fixes the `is_enabled` call and adds additional test
coverage for this macros case.
hds pushed a commit that referenced this pull request May 30, 2025
In the case of an event with a name and a parent, the change in #2083
to use a free function instead of a method for `is_enabled` was not
applied. This particular variant was also not covered by any tests,
which is how this error slipped through CI.

This change fixes the `is_enabled` call and adds additional test
coverage for this macros case.

This change was originally submitted by @Mododo in #2983, but we have an
issue where first-time contributor PRs to the `v0.1.x` branch don't
trigger CI and we can't trigger it manually, so it needed to be
recreated.
@hds
Copy link
Contributor

hds commented May 30, 2025

Can't get CI triggered for a first time contributor PR to v0.1.x, so I've recreated this change in a new PR #3293.

@jplatte
Copy link
Member

jplatte commented May 30, 2025

It looks like I was able to run the workflows.. Not that it's all that useful now that there's another PR 😅

Copy link
Contributor

@hds hds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix!

@hds hds merged commit cdc3212 into tokio-rs:v0.1.x Jun 3, 2025
51 checks passed
hds added a commit that referenced this pull request Nov 26, 2025
# 0.1.42 (November 26, 2025)

### Added

- **attributes**: Support constant expressions as instrument field names ([#3158])
- Add `record_all!` macro for recording multiple values in one call ([#3227])
- **core**: Improve code generation at trace points significantly ([#3398])

### Changed

- `tracing-core`: updated to 0.1.35 ([#3414])
- `tracing-attributes`: updated to 0.1.31 ([#3417])

### Fixed

- Fix "name / parent" variant of `event!` ([#2983])
- Remove 'r#' prefix from raw identifiers in field names ([#3130])
- Fix perf regression when `release_max_level_*` not set ([#3373])
- Use imported instead of fully qualified path ([#3374])
- Make `valueset` macro sanitary ([#3382])

### Documented

- **core**: Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

[#2983]: https://github.com/tokio-rs/tracing/pull/#2983
[#3130]: https://github.com/tokio-rs/tracing/pull/#3130
[#3158]: https://github.com/tokio-rs/tracing/pull/#3158
[#3227]: https://github.com/tokio-rs/tracing/pull/#3227
[#3373]: https://github.com/tokio-rs/tracing/pull/#3373
[#3374]: https://github.com/tokio-rs/tracing/pull/#3374
[#3382]: https://github.com/tokio-rs/tracing/pull/#3382
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
[#3414]: https://github.com/tokio-rs/tracing/pull/#3414
[#3417]: https://github.com/tokio-rs/tracing/pull/#3417
hds added a commit that referenced this pull request Nov 26, 2025
# 0.1.42 (November 26, 2025)

### Important

The [`Span::record_all`] method has been removed from the documented API. It
was always unsuable via the documented API as it requried a `ValueSet` which
has no publically documented constructors. The method remains, but should not
be used outside of `tracing` macros.

### Added

- **attributes**: Support constant expressions as instrument field names ([#3158])
- Add `record_all!` macro for recording multiple values in one call ([#3227])
- **core**: Improve code generation at trace points significantly ([#3398])

### Changed

- `tracing-core`: updated to 0.1.35 ([#3414])
- `tracing-attributes`: updated to 0.1.31 ([#3417])

### Fixed

- Fix "name / parent" variant of `event!` ([#2983])
- Remove 'r#' prefix from raw identifiers in field names ([#3130])
- Fix perf regression when `release_max_level_*` not set ([#3373])
- Use imported instead of fully qualified path ([#3374])
- Make `valueset` macro sanitary ([#3382])

### Documented

- **core**: Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

[#2983]: https://github.com/tokio-rs/tracing/pull/#2983
[#3130]: https://github.com/tokio-rs/tracing/pull/#3130
[#3158]: https://github.com/tokio-rs/tracing/pull/#3158
[#3227]: https://github.com/tokio-rs/tracing/pull/#3227
[#3373]: https://github.com/tokio-rs/tracing/pull/#3373
[#3374]: https://github.com/tokio-rs/tracing/pull/#3374
[#3382]: https://github.com/tokio-rs/tracing/pull/#3382
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
[#3414]: https://github.com/tokio-rs/tracing/pull/#3414
[#3417]: https://github.com/tokio-rs/tracing/pull/#3417
[`Span::record_all`]: https://docs.rs/tracing/0.1.41/tracing/struct.Span.html#method.record_all
hds added a commit that referenced this pull request Nov 26, 2025
# 0.1.42 (November 26, 2025)

### Important

The [`Span::record_all`] method has been removed from the documented API. It
was always unsuable via the documented API as it requried a `ValueSet` which
has no publically documented constructors. The method remains, but should not
be used outside of `tracing` macros.

### Added

- **attributes**: Support constant expressions as instrument field names ([#3158])
- Add `record_all!` macro for recording multiple values in one call ([#3227])
- **core**: Improve code generation at trace points significantly ([#3398])

### Changed

- `tracing-core`: updated to 0.1.35 ([#3414])
- `tracing-attributes`: updated to 0.1.31 ([#3417])

### Fixed

- Fix "name / parent" variant of `event!` ([#2983])
- Remove 'r#' prefix from raw identifiers in field names ([#3130])
- Fix perf regression when `release_max_level_*` not set ([#3373])
- Use imported instead of fully qualified path ([#3374])
- Make `valueset` macro sanitary ([#3382])

### Documented

- **core**: Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

[#2983]: https://github.com/tokio-rs/tracing/pull/#2983
[#3130]: https://github.com/tokio-rs/tracing/pull/#3130
[#3158]: https://github.com/tokio-rs/tracing/pull/#3158
[#3227]: https://github.com/tokio-rs/tracing/pull/#3227
[#3373]: https://github.com/tokio-rs/tracing/pull/#3373
[#3374]: https://github.com/tokio-rs/tracing/pull/#3374
[#3382]: https://github.com/tokio-rs/tracing/pull/#3382
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
[#3414]: https://github.com/tokio-rs/tracing/pull/#3414
[#3417]: https://github.com/tokio-rs/tracing/pull/#3417
[`Span::record_all`]: https://docs.rs/tracing/0.1.41/tracing/struct.Span.html#method.record_all
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.

5 participants