• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..20-Jan-2022-

examples/H20-Jan-2022-516485

src/H20-Jan-2022-814694

tests/H20-Jan-2022-8073

.cargo-checksum.jsonH A D03-May-202289 11

Cargo.lockH A D20-Jan-202210.4 KiB412364

Cargo.tomlH A D20-Jan-20221.3 KiB5746

README.mdH A D20-Jan-20221.4 KiB3832

README.md

1# tracing-tree
2
3Instrument your application with [tracing](https://github.com/tokio-rs/tracing)
4and get tree-structured summaries of your application activity with timing
5information on the console:
6
7<pre>
8 <b>server</b>{host=&quot;localhost&quot;, port=8080<b>}</b>
9    0ms <b> INFO</b> starting
10    300ms <b> INFO</b> listening
11    <b>conn</b>{peer_addr=&quot;82.9.9.9&quot;, port=42381<b>}</b>
12      0ms <b>DEBUG</b> connected
13      300ms <b>DEBUG</b> message received, length=2
14    <b>conn</b>{peer_addr=&quot;8.8.8.8&quot;, port=18230<b>}</b>
15      300ms <b>DEBUG</b> connected
16    <b>conn</b>{peer_addr=&quot;82.9.9.9&quot;, port=42381<b>}</b>
17      600ms <b> WARN</b> weak encryption requested, algo=&quot;xor&quot;
18      901ms <b>DEBUG</b> response sent, length=8
19      901ms <b>DEBUG</b> disconnected
20    <b>conn</b>{peer_addr=&quot;8.8.8.8&quot;, port=18230<b>}</b>
21      600ms <b>DEBUG</b> message received, length=5
22      901ms <b>DEBUG</b> response sent, length=8
23      901ms <b>DEBUG</b> disconnected
24    1502ms <b> WARN</b> internal error
25    1502ms <b> INFO</b> exit
26</pre>
27
28(Format inspired by [slog-term](https://github.com/slog-rs/slog#terminal-output-example))
29
30## Setup
31
32After instrumenting your app with
33[tracing](https://github.com/tokio-rs/tracing), add this subscriber like this:
34
35```rust
36let subscriber = Registry::default().with(HierarchicalLayer::new(2));
37tracing::subscriber::set_global_default(subscriber).unwrap();
38```