pub enum TracingLevel {
Trace,
Debug,
Info,
Warn,
Error,
}Expand description
The LEVEL a node’s spans open at — the closed vocabulary tracing(level = …) writes.
A CLOSED unit enum, because the vocabulary is tracing’s own five and nothing else can be a
level: a sixth word would name something no subscriber could filter on. That is the same test
Label and DatabaseKind are measured by, and the reason this is an enum where an engine or
a backend is a trait.
It mirrors ingraph’s own TracingLevel word for word, which is what makes the emission
mechanical: the model’s variant is the framework’s variant, spelled through
as_str into the path an expansion writes. The DEFAULT lives at the framework
end alone — Declared::TRACING’s own — so this type has none, and a model carrying None is a
declaration that wrote no word rather than one that wrote the default.
Variants§
Trace
tracing(level = trace).
Debug
tracing(level = debug).
Info
tracing(level = info).
Warn
tracing(level = warn).
Error
tracing(level = error).
Implementations§
Source§impl TracingLevel
impl TracingLevel
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The word a declaration writes — and, capitalised by the emitter, the framework variant it names. The two are one string here so a renamed level cannot mean two things.
Sourcepub fn named(word: &str) -> Option<Self>
pub fn named(word: &str) -> Option<Self>
The level this word names, or None where the word is not one of them.
Sourcepub fn variant(self) -> Ident
pub fn variant(self) -> Ident
The framework variant’s own spelling — trace is Trace.
Derived from as_str rather than written a second time, so the word a
declaration writes and the variant an expansion names can never drift apart.
Sourcepub fn constant(self) -> Ident
pub fn constant(self) -> Ident
tracing’s OWN constant for this level — trace is TRACE.
A third spelling of one word, derived from the same string for variant’s
reason. It is a separate reader because the two name different things: that one names this
framework’s vocabulary, and this one names the LIBRARY’s, which an emitted span! has to spell
as a constant because that macro builds its metadata in a static.