slog icon indicating copy to clipboard operation
slog copied to clipboard

slog-term does aggressive isatty check for color support leading to potential issues

Open nikhilm opened this issue 5 years ago • 1 comments

Context: Our test runner uses test log paths that exceed windows MAXPATH (260). When stdout is routed to such a path, the isatty check fails due to an upstream dependency bug - https://github.com/softprops/atty/issues/34

I tried disabling color in such cases by setting force_plain. Unfortunately, since the test uses unwrap_or instead of unwrap_or_else, the tty check is still executed.

it would be nice if this was made lazy.

https://github.com/slog-rs/term/blob/d5d78e87cf0f40cadc927de439e3b1c4e1373810/src/lib.rs#L1259

nikhilm avatar Jul 05 '19 19:07 nikhilm

Indeede! PR please. :)

dpc avatar Jul 05 '19 20:07 dpc