Should I use "tracing" in my library?

111 points lurebat

Hey, I’m designing a library crate.

I want my crate to provide logs for its operation, and from looking around I found the "tracing" crate.

I really like the concept and I think it would be a good fit, I just have one concern -

Since I’m making a library, the point of the logs is for the users to consume them.
The "regular" way to do it is with the "log" crate family, right?
So if a user uses the "log" crate, the can’t access my library logs unless they also set up "tracing" in parallel to their existing logging, which is not great.
I want it to be easy to plug and use.

So I want to know if what I wrote is true, and if it’s the accepted practice

Or maybe I can provide an interface to both?

Thanks