zlog: Support configuring log levels with env var (#28544)

Reimplemented logic from `env_logger` to parse log configuration from
environment variables.

Had to re-implement instead of using `env_filter` crate that
`env_logger` uses, as it does not export the information required to
integrate it.


Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Ben Kunkle 2025-04-10 18:00:44 -04:00 committed by GitHub
parent 44cb8e582b
commit 66dd6726df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 277 additions and 16 deletions

View file

@ -10,7 +10,7 @@ pub fn init(cx: &mut App) {
cx.observe_global::<SettingsStore>(|cx| {
let zlog_settings = ZlogSettings::get_global(cx);
zlog::scope_map::refresh(&zlog_settings.scopes);
zlog::scope_map::refresh_from_settings(&zlog_settings.scopes);
})
.detach();
}