tracing-human-layer

Crates.iotracing-human-layer
lib.rstracing-human-layer
version0.2.1
created_at2023-10-31 20:17:02.753147+00
updated_at2025-09-06 20:22:44.776835+00
descriptionA human-friendly tracing console output layer
homepage
repositoryhttps://github.com/9999years/tracing-human-layer
max_upload_size
id1020333
size326,385
Rebecca Turner (9999years)

documentation

README

tracing-human-layer

docs.rs Crates.io

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

Features:

  • Line-wrapping (optional)
  • Colorful output (customizable and optional)
  • Blank lines between long log messages
  • One-line format for short log messages with one short field

A screenshot of tracing-human-layer output

Quick start

use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use tracing_human_layer::HumanLayer;

tracing_subscriber::registry()
  .with(HumanLayer::new())
  .init();

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.

Commit count: 59

cargo fmt