1250 - add NO_COLOR env var to disable logs colors (#1503)

Fix #1250

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1503
Reviewed-by: Alex <lx@deuxfleurs.fr>
This commit is contained in:
i5-650
2026-08-19 08:03:44 +00:00
committed by Alex
parent c3c8af9a66
commit d9b1dba137
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -276,6 +276,11 @@ fn init_logging(opt: &Opt) {
tracing_subscriber::fmt()
.with_writer(std::io::stderr)
.with_env_filter(env_filter)
.with_ansi(
std::env::var("NO_COLOR")
.map(|x| x != "0" && !x.eq_ignore_ascii_case("false"))
.unwrap_or(true),
)
.init();
}