tracing/tracing-core
Eliza Weisman 1af521e7e6
tracing-core: update to use features available on Rust 1.34 (#106)
## 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>
2019-06-26 16:31:59 -07:00
..

tracing-core

Core primitives for tracing.

Documentation

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.

  • Metadata and Callsite provide information describing Spans.

  • Field, FieldSet, Value, and ValueSet represent the structured data attached to a Span.

  • Dispatch allows span events to be dispatched to Subscribers.

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.