rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
813 stars 126 forks source link

`WriteStyle` is ignored when used with `Target::Pipe` #274

Closed miraclx closed 8 months ago

miraclx commented 1 year ago

The patch https://github.com/rust-cli/env_logger/pull/239, while addressing issue https://github.com/rust-cli/env_logger/issues/208 made it so we can write to a custom sink without being in a test context.

The unfortunate downside of that implementation is it disregards the WriteStyle specification.

No colors when piping to a custom sink is an acceptable default, but when the user specifies WriteStyle::Always, we should have colors written into our sink.