9 releases

✓ Uses Rust 2018 edition

new 0.1.7 Oct 21, 2019
0.1.6 Sep 12, 2019
0.1.5 Aug 17, 2019
0.1.2 Jul 10, 2019
0.0.0 Jun 20, 2019

#23 in Debugging

Download history 2263/week @ 2019-07-08 2645/week @ 2019-07-15 2834/week @ 2019-07-22 3250/week @ 2019-07-29 6703/week @ 2019-08-05 7381/week @ 2019-08-12 5293/week @ 2019-08-19 6810/week @ 2019-08-26 7527/week @ 2019-09-02 8782/week @ 2019-09-09 8392/week @ 2019-09-16 9179/week @ 2019-09-23 11255/week @ 2019-09-30 11597/week @ 2019-10-07 15588/week @ 2019-10-14

35,303 downloads per month
Used in 47 crates (5 directly)

MIT license

125KB
1.5K SLoC

tracing-core

Core primitives for application-level tracing.

Crates.io Documentation Documentation (master) MIT licensed Build Status Discord chat

Documentation | [Chat (gitter)][gitter-url] | Chat (discord)

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::Id 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 and events.

  • Field, FieldSet, Value, and ValueSet represent the structured data attached to spans and events.

  • Dispatch allows spans and 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.

Usage

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.

Subscriber implementations may depend on tracing-core rather than tracing, as the additional APIs provided by tracing are primarily useful for instrumenting libraries and applications, and are generally not necessary for Subscriber implementations.

Crate Feature Flags

The following crate feature flags are available:

  • std: Depend on the Rust standard library (enabled by default).

    no_std users may disable this feature with default-features = false:

    [dependencies]
    tracing-core = { version = "0.1.7", default-features = false }
    

    Note:tracing-core's no_std support requires liballoc.

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.

Dependencies