Bug 1825052 [wpt PR 39246] - Update wpt metadata, a=testonly
[gecko.git] / third_party / rust / tracing-core / README.md
blobf06c760593c92a2448da125e1d398a580eb7deac
1 ![Tracing — Structured, application-level diagnostics][splash]
3 [splash]: https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/splash.svg
5 # tracing-core
7 Core primitives for application-level tracing.
9 [![Crates.io][crates-badge]][crates-url]
10 [![Documentation][docs-badge]][docs-url]
11 [![Documentation (master)][docs-master-badge]][docs-master-url]
12 [![MIT licensed][mit-badge]][mit-url]
13 [![Build Status][actions-badge]][actions-url]
14 [![Discord chat][discord-badge]][discord-url]
16 [Documentation][docs-url] | [Chat][discord-url]
18 [crates-badge]: https://img.shields.io/crates/v/tracing-core.svg
19 [crates-url]: https://crates.io/crates/tracing-core/0.1.30
20 [docs-badge]: https://docs.rs/tracing-core/badge.svg
21 [docs-url]: https://docs.rs/tracing-core/0.1.30
22 [docs-master-badge]: https://img.shields.io/badge/docs-master-blue
23 [docs-master-url]: https://tracing-rs.netlify.com/tracing_core
24 [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
25 [mit-url]: LICENSE
26 [actions-badge]: https://github.com/tokio-rs/tracing/workflows/CI/badge.svg
27 [actions-url]:https://github.com/tokio-rs/tracing/actions?query=workflow%3ACI
28 [discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white
29 [discord-url]: https://discord.gg/EeF3cQw
31 ## Overview
33 [`tracing`] is a framework for instrumenting Rust programs to collect
34 structured, event-based diagnostic information. This crate defines the core
35 primitives of `tracing`.
37 The crate provides:
39 * [`span::Id`] identifies a span within the execution of a program.
41 * [`Event`] represents a single event within a trace.
43 * [`Subscriber`], the trait implemented to collect trace data.
45 * [`Metadata`] and [`Callsite`] provide information describing spans and
46   events.
48 * [`Field`], [`FieldSet`], [`Value`], and [`ValueSet`] represent the
49   structured data attached to spans and events.
51 * [`Dispatch`] allows spans and events to be dispatched to `Subscriber`s.
53 In addition, it defines the global callsite registry and per-thread current
54 dispatcher which other components of the tracing system rely on.
56 *Compiler support: [requires `rustc` 1.49+][msrv]*
58 [msrv]: #supported-rust-versions
60 ## Usage
61   
62 Application authors will typically not use this crate directly. Instead, they
63 will use the [`tracing`] crate, which provides a much more fully-featured
64 API. However, this crate's API will change very infrequently, so it may be used
65 when dependencies must be very stable.
67 `Subscriber` implementations may depend on `tracing-core` rather than `tracing`,
68 as the additional APIs provided by `tracing` are primarily useful for
69 instrumenting libraries and applications, and are generally not necessary for
70 `Subscriber` implementations.
72 ###  Crate Feature Flags
74 The following crate feature flags are available:
76 * `std`: Depend on the Rust standard library (enabled by default).
78   `no_std` users may disable this feature with `default-features = false`:
80   ```toml
81   [dependencies]
82   tracing-core = { version = "0.1.30", default-features = false }
83   ```
85   **Note**:`tracing-core`'s `no_std` support requires `liballoc`.
87 [`tracing`]: ../tracing
88 [`span::Id`]: https://docs.rs/tracing-core/0.1.30/tracing_core/span/struct.Id.html
89 [`Event`]: https://docs.rs/tracing-core/0.1.30/tracing_core/event/struct.Event.html
90 [`Subscriber`]: https://docs.rs/tracing-core/0.1.30/tracing_core/subscriber/trait.Subscriber.html
91 [`Metadata`]: https://docs.rs/tracing-core/0.1.30/tracing_core/metadata/struct.Metadata.html
92 [`Callsite`]: https://docs.rs/tracing-core/0.1.30/tracing_core/callsite/trait.Callsite.html
93 [`Field`]: https://docs.rs/tracing-core/0.1.30/tracing_core/field/struct.Field.html
94 [`FieldSet`]: https://docs.rs/tracing-core/0.1.30/tracing_core/field/struct.FieldSet.html
95 [`Value`]: https://docs.rs/tracing-core/0.1.30/tracing_core/field/trait.Value.html
96 [`ValueSet`]: https://docs.rs/tracing-core/0.1.30/tracing_core/field/struct.ValueSet.html
97 [`Dispatch`]: https://docs.rs/tracing-core/0.1.30/tracing_core/dispatcher/struct.Dispatch.html
99 ## Supported Rust Versions
101 Tracing is built against the latest stable release. The minimum supported
102 version is 1.49. The current Tracing version is not guaranteed to build on Rust
103 versions earlier than the minimum supported version.
105 Tracing follows the same compiler support policies as the rest of the Tokio
106 project. The current stable Rust compiler and the three most recent minor
107 versions before it will always be supported. For example, if the current stable
108 compiler version is 1.45, the minimum supported version will not be increased
109 past 1.42, three minor versions prior. Increasing the minimum supported compiler
110 version is not considered a semver breaking change as long as doing so complies
111 with this policy.
113 ## License
115 This project is licensed under the [MIT license](LICENSE).
117 ### Contribution
119 Unless you explicitly state otherwise, any contribution intentionally submitted
120 for inclusion in Tokio by you, shall be licensed as MIT, without any additional
121 terms or conditions.