mirror of
https://github.com/sivel/speedtest-cli.git
synced 2026-08-04 14:49:36 +00:00
Only add terminal colors with DEBUG if stdout is a tty
This commit is contained in:
parent
48a3d33ae4
commit
e1bab1ab55
1 changed files with 4 additions and 1 deletions
|
|
@ -1653,7 +1653,10 @@ def printer(string, quiet=False, debug=False, error=False, **kwargs):
|
|||
return
|
||||
|
||||
if debug:
|
||||
out = '\033[1;30mDEBUG: %s\033[0m' % string
|
||||
if sys.stdout.isatty():
|
||||
out = '\033[1;30mDEBUG: %s\033[0m' % string
|
||||
else:
|
||||
out = 'DEBUG: %s' % string
|
||||
else:
|
||||
out = string
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue