icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Fixes initialization of SimpleLogger in icu_datagen

Open csmulhern opened this issue 1 year ago • 1 comments

The correct initialization order is

SimpleLogger::new()
    .with_level(log::LevelFilter::Info)
    .env()

Not

SimpleLogger::new()
    .env()
    .with_level(log::LevelFilter::Info)

Both SimpleLogger::env and SimpleLogger::with_level both override SimpleLogger::default_level. SimpleLogger::env should be called after SimpleLogger::with_level, so that RUST_LOG can override the default level set by SimpleLogger::with_level, if present. See: https://github.com/borntyping/rust-simple_logger/blob/fb96a82c274f92eff417904e6e819f25f3b51ccc/src/lib.rs#L153-L158

Without this change, setting RUST_LOG does not affect the log level used by icu-datagen.

csmulhern avatar Jun 30 '24 02:06 csmulhern

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 30 '24 02:06 CLAassistant

Rebased and signed CLA. Should be good to merge.

csmulhern avatar Jul 01 '24 16:07 csmulhern