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

core: change metadata::Kind to a bitflag #1891

Merged
merged 2 commits into from
Feb 3, 2022
Merged

core: change metadata::Kind to a bitflag #1891

merged 2 commits into from
Feb 3, 2022

Commits on Feb 3, 2022

  1. core: change metadata::Kind to a bitflag

    This changes the `Kind` type to a bitflag, in order to represent
    callsites that are hints but also count as spans or events. The goal
    here is to allow variants of the `enabled!` macro that specifically
    check if a span would be enabled, or if an event would be enabled.
    
    This does not actually implement the `enabled!` variants, just the
    `Kind` representation change. This way, we can add to the `enabled!`
    macro in a subsequent `tracing` release without having to change
    `tracing-core` again.
    
    I went with the bitflag representation rather than adding a bool to the
    `KindInner::Span` and `KindInner::Event` enum variants because it felt a
    bit simpler and maybe more performant, although I don't think it's
    particularly important to micro-optimize here. I'd consider changing
    this to an enum-based representation if people think it's significantly
    easier to understand.
    hawkw committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    4f6ed20 View commit details
    Browse the repository at this point in the history
  2. fix docs links

    hawkw committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    d45679a View commit details
    Browse the repository at this point in the history