Closed joshka closed 6 months ago
Why did you use tracing instead of log?
Why did you use tracing instead of log?
I'd like to add more more instrumentation to the methods to make it easy to build out a tui for mastodon (https://github.com/joshka/tooters). The approach in tracing
crate is better for this than log
crate. E.g. the #[instrument]
attribute, and the ability to log values as the value and not just as a text string (log does have the kv feature, but it's more difficult to support and not as powerful as the values approach). Filtering specific logs and directing them is also easier in tracing. Tracing makes it possible to more easily see which network calls are part of which operation using the concept of spans around groups of calls.
Tracing can be configured to send events to to log
(and also the reverse), so there's no real downside to this and a bunch of upside.
OK, thanks.
Before:
After: