-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
[Question][Bug] How come load_env_levels() overrides levels to default of info when SPDLOG_LEVEL env var doesn't exist? #1680
Comments
It is not by design. This is indeed an annoying bug |
I have a fix I'll try to submit as a patch this weekend for the empty env var + unit tests for that case. Is the |
Don't bother. My fix is almost ready.
Also a bug. Will be fixed as well. |
@Tridacnid Fixed. Please verify works for you as well |
Ran some quick tests and everything looks like it's behaving nicely now, thanks! |
It looks like calling load_env_levels() when SPDLOG_LEVEL doesn't exist overwrites every registered logger's level to a default of "info". Additionally, when SPDLOG_LEVEL does exist but only specifies a couple logger's levels, the others have their levels overwritten to the default of info.
pseduo-code example:
Is this by design? It's certainly annoying that a missing env var will reset the logger levels I have specified in my source code. I wouldn't expect a logger's level to change if it wasn't present in the env var.
As a side note, it looks like the argv processing suffers from this same behavior.
The text was updated successfully, but these errors were encountered: