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

Experiment with using tracing instead of log #1014

Open
kevinaboos opened this issue Jul 22, 2023 · 0 comments
Open

Experiment with using tracing instead of log #1014

kevinaboos opened this issue Jul 22, 2023 · 0 comments

Comments

@kevinaboos
Copy link
Member

kevinaboos commented Jul 22, 2023

Proposed Benefits

The log crate is decent and easy to support, but it lacks some of the nicer features of more powerful logging systems like tracing. For example, it'd be nice to have an easier way to disable all log statements in a certain crate or module, or of a certain level within a given file, etc. The structured logging and span functionality all look attractive too.

Most importantly, this would help a user/developer more easily filter out the log statements that are of interest to them in a specific testing/debugging scenario. With log macros, we just have to generally enable all logging levels in all crates, and then tediously grep for keywords or file names.

Considerations

The tracing crate does support no_std, but interestingly enough it requires alloc support on no_std. So that means we can use it in most crates, but not all crates (i.e., those that must run during early bootstrap before heap allocation is initialized).

First steps

If anyone is interested in helping out, the best/easiest first step would likely be to play around with tracing as a drop-in replacement for log, which is easy enough because it offers the same basic macros.

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

No branches or pull requests

1 participant