serpent-os / boulder-d-legacy

Replaced by Rust tooling
https://serpentos.com
21 stars 7 forks source link

Add flag/option to disable colored output if not running in terminal #82

Closed der-eismann closed 1 year ago

der-eismann commented 1 year ago

While reading the build logs from summit, the output from moss is quite hard to read with stuff like this:

[02:03:51] WARNING   Using non-standard configuration directory: /srv/avalanche/avalanche/state/work
[02:03:51] INFO      Stage success: create-root
[02:04:03] INFO      Stage success: fetch-upstreams
 WARNING   Unable to discover Active State ID
 INFO      Rebuilding indices on `repo0`
 INFO      Added remote repo0
[02:04:03] INFO      Stage success: configure-root
 WARNING   Unable to discover Active State ID
The following packages will be installed

acl - 2.3.1-2                libxcb - 1.15-2              
attr - 2.5.1-2               libxcb-devel - 1.15-2        
bash - 5.2.15-5              libxcrypt - 4.4.33-3         
boulder - 0.1-32             libxext - 1.3.5-3            
brotli - 1.0.9-3             libxext-devel - 1.3.5-3      
bzip2 - 1.0.8-2              libxml2 - 2.10.3-4      

Would be great if it's possible to disable the colored output and have a better overview when reading the logs.

livingsilver94 commented 1 year ago

Detecting whether or not the output goes to a TTY is super simple: https://forum.dlang.org/thread/mailman.327.1386419696.3242.digitalmars-d-learn@puremagic.com

The usual approach is: