tracing_human_layer/lib.rs
1//! A human-friendly and colorful terminal output [`tracing_subscriber::Layer`] for [`tracing`].
2//!
3//! ## Performance
4//!
5//! TL;DR: Half of the cost of logging is writing to stderr.
6//!
7//! I haven't done too much performance work on `tracing-human-layer`, but I do have a couple
8//! benchmarks. It seems to take 1.92-6.17µs to format an event (including emitting a span and event),
9//! with the exact cost depending on whether or not color output
10//! ([`HumanLayer::with_color_output`]) or text wrapping ([`HumanLayer::with_textwrap_options`])
11//! is enabled.
12//!
13//! Formatting an event _and writing it to stderr_ takes 12.55µs, so actually showing the logs to the
14//! user is about 2× slower than just formatting them.
15
16#![deny(missing_docs)]
17
18pub use layer::HumanLayer;
19pub use style::LayerStyles;
20pub use style::ProvideStyle;
21pub use style::Style;
22pub use textwrap::TextWrapOptionsOwned;
23
24pub(crate) use color::ShouldColor;
25pub(crate) use event::HumanEvent;
26pub(crate) use fields::HumanFields;
27pub(crate) use span_fields::StyledSpanFields;
28pub(crate) use span_info::SpanInfo;
29
30mod color;
31mod event;
32mod fields;
33mod layer;
34mod span_fields;
35mod span_info;
36mod style;
37mod textwrap;