origin
origin copied to clipboard
Switch from log to tracing and drop logger implementation
Origin should switch from the log crate to the tracing crate. Tracing brings support for scoping and nesting and overall has become the "standard" way to log/trace code. It's already used in official projects including rust itself.
Switching to tracing is extremely straightforward and fully backwards compatible since it can still emit log messages with a compatibility layer.
At the same time I'd like to propose a breaking change: the removal of env_logger and atomic-dbg-logger. It doesn't make any sense for a library to init the logger even a low level one as origin. The logging subscriber should be left to the consumers of the library instead. Currently it's very easy to just not enable the feature but I feel like they should just be removed for the next breaking release.
Moving to tracing
sounds good. What's the best thing to recommend for users wanting to just see the tracing output on stderr?
The motivation for initializing env_logger
or atomic-dbg-logger
is that origin can initialize them earlier in the program startup sequence than a user could, so they can issue messages for more of the things that origin does. I'm open to other approaches, but I'd like to retain that functionality.