
## Motivation Since the minimum Rust version is now Rust 1.34, we can address some long-standing TODOs that were previously not possible to address because they required features unavailable on Rust 1.26. ## Solution This branch adds public `const fn` constructors to `tracing_core::Metadata` and `tracing_core::field::FieldSet`, and changes the internal representation of `tracing_core::span::Id` to benefit from non-zero optimization. We cannot add a `const fn` constructor for `callsite::Identifier` at this time, since trait objects as const fn parameters are not stable. Metadata is still constructed using the `metadata!` macro, as it also uses the `file!()`, `line!()`, and `module_path!()` macros, but the `const fn` constructor means that `Metadata`'s fields need no longer be `#[doc(hidden)] pub`. Closes #105 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
tracing-core
Core primitives for tracing
.
Overview
tracing
is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. This crate defines the core
primitives of tracing
.
The crate provides:
-
Span
identifies a span within the execution of a program. -
Event
represents a single event within a trace. -
Subscriber
, the trait implemented to collect trace data. -
Field
,FieldSet
,Value
, andValueSet
represent the structured data attached to aSpan
. -
Dispatch
allows span events to be dispatched toSubscriber
s.
In addition, it defines the global callsite registry and per-thread current dispatcher which other components of the tracing system rely on.
Application authors will typically not use this crate directly. Instead, they
will use the tracing
crate, which provides a much more fully-featured
API. However, this crate's API will change very infrequently, so it may be used
when dependencies must be very stable.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions.