Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: change
metadata::Kind
to a bitflag (#1891)
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. See [this comment][1] for details. 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. [1]: #1821 (comment)
- Loading branch information