1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Structured, levelled logging (feature `trace`, default-on).
//!
//! This module exists because this workspace forbids `println!`/`eprintln!` in
//! library code and names `tracing` as the replacement, but `tracing` was
//! absent from every crate. A library author following that rule had nothing to
//! use, and one ignoring it had `println!`; the rule was enforceable against
//! the wrong practice and unenforceable in favour of the right one.
//!
//! It is a re-export, like [`json`](crate::json): this crate names the
//! capability rather than the crate, so replacing the implementation is one
//! change here rather than one per consumer.
//!
//! # What is here, and what is not
//!
//! The **macros and core types** are here, which is what calling code needs.
//! The `attributes` feature is deliberately not enabled (see the note in
//! `Cargo.toml`), so `#[instrument]` is unavailable from this path; it would
//! pull `syn` into the foundation crate.
//!
//! There is also **no subscriber**. `tracing` records; a separate crate
//! decides where records go. Bundling one would choose an output format, a
//! writer, and a filter syntax on behalf of every consumer, which is a
//! different decision from "the macros are available". A binary installs its
//! own subscriber; a library must only emit.
//!
//! # Levels
//!
//! `ERROR` for a broken contract, `WARN` for degraded but serving, `INFO` for
//! lifecycle, `DEBUG` for developer diagnostics, `TRACE` for wire-level.
//!
//! # Example
//!
//! ```
//! use lgwks_std::trace::{info, warn};
//!
//! // A library emits. With no subscriber installed these are near-free no-ops;
//! // the binary that links this installs the subscriber that decides where
//! // records go.
//! info!(bytes = 512, "read a record");
//! warn!(remaining = 3, "retry budget is nearly spent");
//! ```
//!
//! Structured fields, not interpolated strings: a subscriber can filter on
//! `bytes` without parsing the message, which is the property `println!` cannot
//! provide, and the reason `println!` is banned in library code.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// `Instrument` (the future combinator) is core; `#[instrument]` (the attribute)
// is not, because it lives behind the `attributes` feature this crate declines.
pub use Instrument;
/// Structured fields attached to an event or span.
///
/// Module rather than a re-export: call sites spell `field::Empty` and
/// `field::display`, so the path has to survive verbatim.
pub use field;