diff --git a/scripts/wk/cfg/log.py b/scripts/wk/cfg/log.py index a9a6e6ca..06f79df4 100644 --- a/scripts/wk/cfg/log.py +++ b/scripts/wk/cfg/log.py @@ -10,7 +10,7 @@ DEBUG = { DEFAULT = { 'level': 'INFO', 'format': '[%(asctime)s %(levelname)s] %(message)s', - 'datefmt': '%Y-%m-%d %H:%M:%S %z', + 'datefmt': '%Y-%m-%d %H%M%z', } diff --git a/scripts/wk/std.py b/scripts/wk/std.py index 36417f8b..96da0c08 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -463,6 +463,13 @@ class TryAndPrint(): obj = getattr(sys.modules['builtins'], name) return obj + def _log_result(self, message, result_msg): + """Log result text without color formatting.""" + log_text = f'{" "*self.indent}{message:<{self.width}}{result_msg}' + for line in log_text.splitlines(): + line = strip_colors(line) + LOG.info(line) + def add_error(self, exception_name): """Add exception name to error list.""" if exception_name not in self.list_errors: @@ -539,7 +546,7 @@ class TryAndPrint(): raise # Done - LOG.info('Result: %s', result_msg.strip()) + self._log_result(message, result_msg) return { 'Failed': bool(f_exception), 'Exception': f_exception,