mirror of
https://github.com/sivel/speedtest-cli.git
synced 2026-09-30 10:12:25 +02:00
Only add terminal colors with DEBUG if stdout is a tty
This commit is contained in:
+4
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user