[Feature request] Disable color logs when not a terminal #462
Labels
enhancement
Refactor existing code for better performance and quality
new feature
New feature or request
output
Typos, log messages and better output
Is your feature request related to a problem? Please describe.
At the moment
tfswitch
outputs logs with colors no matter whether it is run interactively or from within automation. Along with this when running within CI/CD or whentfswitch
output is piped to another command or is written to a log-file it may be desired to log to console w/o colors to avoid vomiting console with escape sequences.Describe the solution you'd like
--force-color
cmdline arg so users can enable color output explicitly) OR add--no-color
cmdline arg to let user decide explicitly per use-case (additionally considerNO_COLOR
env var: https://no-color.org/)💡 Forcing color in non-interactive mode might be preferred e.g. when running within CI/CD pipeline that supports rendering ANSI escape sequences (e.g. https://plugins.jenkins.io/ansicolor/).
Additional context
Refs:
The text was updated successfully, but these errors were encountered: