avocado.core.output: Introduce fail error headers to OutputManager

In order to color error messages more prominently,
introduce fail headers, colored red, to provide
visual cues of what's going on.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 c61e6bb3
......@@ -103,6 +103,14 @@ class TermColors(object):
"""
return self.HEADER + sr + self.ENDC
def fail_header_str(self, sr):
"""
Print a fail header string (red colored).
If the output does not support colors, just return the original string.
"""
return self.FAIL + sr + self.ENDC
def pass_str(self):
"""
Print a pass string (green colored).
......@@ -221,6 +229,14 @@ class OutputManager(object):
"""
self.info(colors.header_str(sr))
def log_fail_header(self, sr):
"""
Log a fail header message (red, for critical errors).
:param sr: String to write.
"""
self.info(colors.fail_header_str(sr))
def log_pass(self, label, t_elapsed):
"""
Log a test PASS message.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册