Crate tracing_human_layer

Crate tracing_human_layer 

Source
Expand description

A human-friendly and colorful terminal output tracing_subscriber::Layer for tracing.

§Performance

TL;DR: Half of the cost of logging is writing to stderr.

I haven’t done too much performance work on tracing-human-layer, but I do have a couple benchmarks. It seems to take 1.92-6.17µs to format an event (including emitting a span and event), with the exact cost depending on whether or not color output (HumanLayer::with_color_output) or text wrapping (HumanLayer::with_textwrap_options) is enabled.

Formatting an event and writing it to stderr takes 12.55µs, so actually showing the logs to the user is about 2× slower than just formatting them.

Structs§

HumanLayer
A human-friendly tracing_subscriber::Layer.
LayerStyles
A simple ProvideStyle implementation which stores a style for each tracing::Level.
Style
The style for formatting a tracing event.
TextWrapOptionsOwned
Options for wrapping and filling text. Like textwrap::Options, but owned.

Traits§

ProvideStyle
A value that can provide a Style for a given tracing event.