-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable color in logs when not printing to a tty (#18662)
### Ticket N/A ### Problem description The logger applies text styling that only work in the terminal, if we use the log file env var or redirect `stdout` to a file then we end up with ``` ^[[38;2;000;128;000m Metal^[[0m | ^[[1m^[[38;2;100;149;237mINFO ^[[0m | Initializing device 0. Program cache is NOT enabled ^[[38;2;000;128;000m Metal^[[0m | ^[[1m^[[38;2;100;149;237mINFO ^[[0m | AI CLK for device 0 is: 1000 MHz ^[[38;2;000;128;000m Metal^[[0m | ^[[1m^[[38;2;100;149;237mINFO ^[[0m | Enabling program cache on device 0 ``` ### What's changed Modify the logger to disable all `fmt` styling if the output isn't a tty. Signed-off-by: wenbinlyuTT <wenbinlyu@tenstorrent.com>
- Loading branch information
1 parent
07567d1
commit 769d3d0
Showing
1 changed file
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters