diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /vendor/tracing-tree/README.md | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/tracing-tree/README.md')
-rw-r--r-- | vendor/tracing-tree/README.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/tracing-tree/README.md b/vendor/tracing-tree/README.md new file mode 100644 index 000000000..06751d4ec --- /dev/null +++ b/vendor/tracing-tree/README.md @@ -0,0 +1,38 @@ +# tracing-tree + +Instrument your application with [tracing](https://github.com/tokio-rs/tracing) +and get tree-structured summaries of your application activity with timing +information on the console: + +<pre> + <b>server</b>{host="localhost", port=8080<b>}</b> + 0ms <b> INFO</b> starting + 300ms <b> INFO</b> listening + <b>conn</b>{peer_addr="82.9.9.9", port=42381<b>}</b> + 0ms <b>DEBUG</b> connected + 300ms <b>DEBUG</b> message received, length=2 + <b>conn</b>{peer_addr="8.8.8.8", port=18230<b>}</b> + 300ms <b>DEBUG</b> connected + <b>conn</b>{peer_addr="82.9.9.9", port=42381<b>}</b> + 600ms <b> WARN</b> weak encryption requested, algo="xor" + 901ms <b>DEBUG</b> response sent, length=8 + 901ms <b>DEBUG</b> disconnected + <b>conn</b>{peer_addr="8.8.8.8", port=18230<b>}</b> + 600ms <b>DEBUG</b> message received, length=5 + 901ms <b>DEBUG</b> response sent, length=8 + 901ms <b>DEBUG</b> disconnected + 1502ms <b> WARN</b> internal error + 1502ms <b> INFO</b> exit +</pre> + +(Format inspired by [slog-term](https://github.com/slog-rs/slog#terminal-output-example)) + +## Setup + +After instrumenting your app with +[tracing](https://github.com/tokio-rs/tracing), add this subscriber like this: + +```rust +let subscriber = Registry::default().with(HierarchicalLayer::new(2)); +tracing::subscriber::set_global_default(subscriber).unwrap(); +```
\ No newline at end of file |