Decrusting the tracing crate
In this stream, we peel back the crust on the tracing crate —
https://github.com/tokio-rs/tracing/ — and explore its interface,
structure, and mechanisms. We talk about spans, events, their attributes
and fields, and how to think about them in async code. We also dig into
into what subscribers are, how they pick up events, and how you can
construct your own subscribers through the layer abstraction.
For more details about tracing, see https://docs.rs/tracing/latest/tracing/.
0:00:00 Introduction
0:03:00 Spans and events
0:38:56 Spans across thread boundaries
0:45:30 Spans in async context
1:02:20 Making format subscriber print span enter/exits
1:06:14 Compatibility with log
1:12:39 Event and span targets
1:20:51 The Subscriber trait
1:45:05 tracing-subscriber and the fmt subscriber
1:49:31 Blocking in Subscribers
1:54:50 The Layer abstraction
2:12:00 Dispatch
2:13:45 Per-layer filtering
2:33:34 Changing subscriber during runtime
2:41:59 Getting from the current subscriber to a layer
2:45:16 Do subscribers have layers?
2:47:06 Choosing logging levels
2:49:07 tracing for logging vs debugging
2:49:57 Moving from console logging to TUI logging at runtime
2:52:09 Other tracing-related crates
Live version with chat: https://youtube.com/live/2tm2zH-ECVw
Other Videos By Jon Gjengset
2025-05-30 | Explaining assembly by playing SHENZHEN I/O |
2025-03-10 | Porting the guff plot device to Rust |
2025-01-02 | January 2025 Q&A |
2024-09-21 | Decrusting the quickcheck crate |
2024-08-25 | Implementing a Lox interpreter in Rust |
2024-07-14 | Open Source Maintenance, 2024-07-14 |
2024-05-18 | What's New in Rust 1.72-1.78 Rustacean Station marathon |
2024-05-04 | Q&A May 2024 |
2024-04-05 | Decrusting the tokio crate |
2024-03-09 | Implementing (parts of) git from scratch in Rust |
2024-02-09 | Decrusting the tracing crate |
2024-02-06 | Jon Gjengset Live Stream |
2024-01-14 | Hardware and software [2024 edition] |
2023-12-16 | Q&A December 2023 |
2023-12-15 | Q&A Session |
2023-11-17 | Making the (partial) Rust BitTorrent client more reasonable |
2023-10-19 | Implementing (part of) a BitTorrent client in Rust |
2023-08-26 | Open Source Maintenance, 2023-08-25 |
2023-08-13 | Open Source Maintenance, 2023-08-13 |
2023-08-06 | Open Source Maintenance, 2023-08-06 |
2023-07-31 | Rust "did you know": handy cargo tools |