mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-09-06 03:59:15 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user