softprops / json-env-logger

A structured JSON logger for Rust.
MIT License
30 stars 13 forks source link

Add builder_from_env to use custom env var #13

Open DaveWK opened 2 years ago

DaveWK commented 2 years ago

This adds a wrapper to Builder::from_env so a variable other than RUST_LOG can be used

This also updates the log crate to the latest, where the feature has been changed to "kv_unstable_std", as well as updates env_logger to 0.9

I added a WriteAdapter struct into the tests to capture log output into variables for testing

DaveWK commented 2 years ago

I have added some helpers to the tests to allow the logger to be replaced by a new instance. This also required making 2 of the tests run serially to avoid changing the filters/formatters that another test depended on.