rustrust-tracing

Is there a lightweight alternative to tracing-subscriber?


The tracing-subscriber crate contains a ton of features and adds about 300k to my binary. I'm looking for a very lightweight alternative that only prints all the spans to std-out.

I assume that there is an API to implement for a completely custom subscriber but it doesn't seem very documented as everyone is basically using tracing-subscriber as is, or customizing that library.


Solution

  • You need to implement Subscriber and call tracing::subscriber::set_global_default(). This is fairly well documented.