Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from log to tracing and drop logger implementation #79

Open
morr0ne opened this issue Oct 12, 2023 · 1 comment
Open

Switch from log to tracing and drop logger implementation #79

morr0ne opened this issue Oct 12, 2023 · 1 comment

Comments

@morr0ne
Copy link
Contributor

morr0ne commented Oct 12, 2023

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.

@sunfishcode
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants