tracing-tree2

Crates.iotracing-tree2
lib.rstracing-tree2
version0.3.0
sourcesrc
created_at2023-02-05 01:51:11.622688
updated_at2023-02-05 01:51:11.622688
descriptionA Tracing Layer which prints a tree of spans and events.
homepage
repositoryhttps://github.com/aschey/tracing-tree
max_upload_size
id776771
size71,531
Austin Schey (aschey)

documentation

README

tracing-tree

Instrument your application with tracing and get tree-structured summaries of your application activity with timing information on the console:

 
 server{host="localhost", port=8080}
    0ms  INFO starting
    300ms  INFO listening
    conn{peer_addr="82.9.9.9", port=42381}
      0ms DEBUG connected
      300ms DEBUG message received, length=2
    conn{peer_addr="8.8.8.8", port=18230}
      300ms DEBUG connected
    conn{peer_addr="82.9.9.9", port=42381}
      600ms  WARN weak encryption requested, algo="xor"
      901ms DEBUG response sent, length=8
      901ms DEBUG disconnected
    conn{peer_addr="8.8.8.8", port=18230}
      600ms DEBUG message received, length=5
      901ms DEBUG response sent, length=8
      901ms DEBUG disconnected
    1502ms  WARN internal error
    1502ms  INFO exit

(Format inspired by slog-term)

Setup

After instrumenting your app with tracing, add this subscriber like this:

let subscriber = Registry::default().with(HierarchicalLayer::new(2));
tracing::subscriber::set_global_default(subscriber).unwrap();
Commit count: 52

cargo fmt