| Crates.io | tracing-tape |
| lib.rs | tracing-tape |
| version | 0.1.1 |
| created_at | 2024-11-10 13:23:51.966378+00 |
| updated_at | 2024-11-19 13:52:31.346682+00 |
| description | Binary format specification for the tracing crate |
| homepage | https://github.com/soehrl/tracing-tape |
| repository | https://github.com/soehrl/tracing-tape |
| max_upload_size | |
| id | 1442898 |
| size | 19,051 |
Dead-simple debugging and profiling of (distributed) Rust applications using the tracing crate. Record trace files and view them within within seconds without complex setup or configuration.
cargo add tracing tracing-subscriber tracing-tape-recorder
use tracing::trace_span;
use tracing_subscriber::{fmt, layer::SubscriberExt, Registry};
use tracing_tape_recorder::TapeRecorder;
let subscriber = Registry::default().with(TapeRecorder::default());
let guard = tracing::subscriber::set_default(subscriber);
// ...
drop(guard);
Running your application will now generate a {name}-{timestamp}.tape file in the current working directory.
Note: it is preferred to use set_default instead of set_global_default to ensure the subsriber is dropped when the guard goes out of scope.
See #7 for more information.
You can use the trace-deck application to view the recorded tape files either by running trace-deck filename.tape or by dragging the files into the window.
You can load multiple files simultaneously which can be useful for analyzing workflows across multiple applications (e.g., client-server interactions).
Have a look at the getting started guide.