Decide coloring once at startup.
(no_color_flag: bool)
| 14 | |
| 15 | /// Decide coloring once at startup. |
| 16 | pub fn init(no_color_flag: bool) { |
| 17 | let off = no_color_flag || std::env::var_os("NO_COLOR").is_some() || !std::io::stdout().is_terminal(); |
| 18 | PLAIN.store(off, Ordering::Relaxed); |
| 19 | } |
| 20 | |
| 21 | fn plain() -> bool { |
| 22 | PLAIN.load(Ordering::Relaxed) |
no outgoing calls
no test coverage detected