Skip to content

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.

@Ctru14
Copy link

Ctru14 commented Jul 25, 2025

Hey @t-moe, can we pick this PR discussion back up? This would be a very useful feature. What needs to happen to get the ball rolling and get this runtime filtering added?

@t-moe
Copy link
Contributor Author

t-moe commented Aug 5, 2025

Hey @t-moe, can we pick this PR discussion back up? This would be a very useful feature. What needs to happen to get the ball rolling and get this runtime filtering added?

Hey @Ctru14,
I cannot drive this forward without input from the maintainers. Also, I'm currently working on a non-embedded project, so this has a low priority for me. But feel free to take over, if you have the need & capacity.

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.

2 participants