#tracing #tree #console

tracing-tree

A Tracing Layer which prints a tree of spans and events

15 releases

0.2.2 Nov 11, 2022
0.2.1 May 26, 2022
0.2.0 Dec 6, 2021
0.1.11 Nov 22, 2021
0.1.4 Jul 13, 2020

#63 in Debugging

Download history 17275/week @ 2022-10-13 17412/week @ 2022-10-20 17274/week @ 2022-10-27 20436/week @ 2022-11-03 20838/week @ 2022-11-10 19109/week @ 2022-11-17 17954/week @ 2022-11-24 17609/week @ 2022-12-01 19632/week @ 2022-12-08 18137/week @ 2022-12-15 15956/week @ 2022-12-22 18614/week @ 2022-12-29 20413/week @ 2023-01-05 19589/week @ 2023-01-12 19510/week @ 2023-01-19 18322/week @ 2023-01-26

81,167 downloads per month
Used in 20 crates (16 directly)

MIT/Apache

28KB
700 lines

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();

Dependencies

~1.5MB
~25K SLoC