diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index b50f2a7523..7dbbb3cf5a 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -52,10 +52,6 @@ try: except ImportError: import xml.etree.cElementTree as ET -try: - import mdv -except ImportError: - mdv = None from .vfb_server import get_virual_frame_buffer_server from .httpserver import HTTPServer @@ -638,13 +634,16 @@ class Test(Loggable): self.start_ts = time.time() def _dump_log_file(self, logfile): + if which('bat'): + try: + subprocess.check_call(['bat', '-H', '1', '--paging=never', logfile]) + return + except (subprocess.CalledProcessError, FileNotFoundError): + pass + with open(logfile, 'r') as fin: - printc(self.get_logfile_repr()) - if mdv and utils.supports_ansi_colors(): - printc(mdv.main(fin.read())) - else: - for line in fin.readlines(): - print('> ' + line, end='') + for line in fin.readlines(): + print('> ' + line, end='') def _dump_log_files(self): self._dump_log_file(self.logfile) diff --git a/validate/launcher/main.py b/validate/launcher/main.py index 898ef63c31..0b1fd46f42 100644 --- a/validate/launcher/main.py +++ b/validate/launcher/main.py @@ -463,7 +463,8 @@ class LauncherConfig(Loggable): parser.add_argument("--dump-on-failure", dest="dump_on_failure", action="store_true", default=False, help="Dump logs to stdout when a test fails." - " Note that mdv is used to enhance output if avalaible, install with `pip install mdv`.") + " Note that bat is used to enhance output if available" + " (See https://github.com/sharkdp/bat)") parser.add_argument("--max-dump-size", dest="max_dump_size", type=float, default=0.5, help="Maximum size of logs to dump on stdout in MB.") parser.add_argument("-c", "--config", dest="config",