Skip to content

Commit

Permalink
tracing: document that event_enabled! does not call `Collect::event…
Browse files Browse the repository at this point in the history
…_enabled` (#2179)

Although it shares the name, `event_enabled!` *does not* call
`Collect::event_enabled`. `Collect::event_enabled` is only called once
the event fields are available.
  • Loading branch information
CAD97 authored Jun 28, 2022
1 parent 7008df9 commit 7a9e1e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tracing/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,9 @@ macro_rules! event {
/// This is similar to [`enabled!`], but queries the current collector specifically for
/// an event, whereas [`enabled!`] queries for an event _or_ span.
///
/// Although it shares the name, this *does not* call [`Collect::event_enabled`].
/// `Collect::event_enabled` is only called once the event fields are available.
///
/// See the documentation for [`enabled!]` for more details on using this macro.
/// See also [`span_enabled!`].
///
Expand All @@ -826,6 +829,7 @@ macro_rules! event {
/// }
/// ```
///
/// [`Collect::event_enabled`]: crate::Collect::event_enabled
/// [`enabled!`]: crate::enabled
/// [`span_enabled!`]: crate::span_enabled
#[macro_export]
Expand Down

0 comments on commit 7a9e1e4

Please sign in to comment.