Browse Source

Only add terminal colors with DEBUG if stdout is a tty

pull/380/merge
Matt Martz 5 years ago
parent
commit
e1bab1ab55
  1. 5
      speedtest.py

5
speedtest.py

@ -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…
Cancel
Save