Skip to content

[WIP] Add support for runtime filtering #947

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

t-moe
Copy link
Contributor

@t-moe t-moe commented Mar 14, 2025

I want to discuss how a possible API could look, to set a global min log level, used for runtime filtering.

This PR adds set_global_log_level which stores the minimal log level in a static AtomicU8.

Other approaches I could think of:

  • Pass the LogLevel of the message to the Logger impl and let them figure out where they want to store the min log level. like in Log::enabled of the log crate

Sidenotes:

  • In the current implementation I use the IdRanges struct that I have added in an earlier PR, but I realize now, that I could also pass the LogLevel from the macro implementation directly.
  • The current implementation works on the target, but for the tests to work in CI it would obviosly need some more work.

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

Successfully merging this pull request may close these issues.

1 participant