Enabled ANSI formatting in the tracing formatter whenever stderr is attached to a terminal so colorized updater messages render correctly instead of showing escape sequences.

This commit is contained in:
Mick Grove 2025-09-17 14:54:01 -07:00
commit 8cf4b4ba95
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,8 @@
# Changelog
All notable changes to this project will be documented in this file.
## [Unreleased]
- Enabled ANSI formatting in the tracing formatter whenever stderr is attached to a terminal so colorized updater messages render correctly instead of showing escape sequences.
## [1.51.0]
- Added diff-only Git scanning via `--since-commit` and `--branch`, including remote-aware ref resolution so CI jobs can pair `--git-url` clones with pull request branches

View file

@ -27,7 +27,7 @@ static GLOBAL: System = System;
// static GLOBAL: System = System;
use std::{
io::Read,
io::{IsTerminal, Read},
sync::{Arc, Mutex},
};
@ -122,7 +122,7 @@ fn setup_logging(global_args: &GlobalArgs) {
let fmt_layer = fmt::layer()
.with_writer(std::io::stderr) // Write logs to stderr
.with_target(true) // Enable target filtering
.with_ansi(false) // Disable colors
.with_ansi(std::io::stderr().is_terminal()) // Emit ANSI colours when stderr is a TTY
.without_time(); // Remove timestamps
// Build and initialize the registry
registry()