When running tests there is no situation in which we want ANSI output as
it makes it much harder to see what is going on in logs, tests, etc.
Provide a way to disable this.
Signed-off-by: Simon Glass <sjg@chromium.org>
"""
_output(0, msg)
-def init(_verbose=WARNING, stdout=sys.stdout):
+def init(_verbose=WARNING, stdout=sys.stdout, allow_colour=True):
"""Initialize a new output object.
Args:
verbose = _verbose
_progress = '' # Our last progress message
- _color = terminal.Color()
+ _color = terminal.Color(terminal.COLOR_IF_TERMINAL if allow_colour
+ else terminal.COLOR_NEVER)
_stdout = stdout
# TODO(sjg): Move this into Chromite libraries when we have them