diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 235f04875..6aa0a3751 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -204,7 +204,7 @@ class Summary: def dump_value(self, arr, list_sep, indent): lines_sep = '\n' + ' ' * indent if list_sep is None: - mlog.log(*arr, sep=lines_sep) + mlog.log(*arr, sep=lines_sep, display_timestamp=False) return max_len = shutil.get_terminal_size().columns line = [] @@ -218,7 +218,7 @@ class Summary: line = [] line.append(v) line_len += v_len - mlog.log(*line, sep=list_sep) + mlog.log(*line, sep=list_sep, display_timestamp=False) known_library_kwargs = ( build.known_shlib_kwargs | diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index b4314280d..e51399b4f 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -200,9 +200,9 @@ class _Logger: self.log_file = open(os.path.join(logdir, self._LOG_FNAME), 'w', encoding='utf-8') self.log_fatal_warnings = fatal_warnings - def process_markup(self, args: T.Sequence[TV_Loggable], keep: bool) -> T.List[str]: + def process_markup(self, args: T.Sequence[TV_Loggable], keep: bool, display_timestamp: bool = True) -> T.List[str]: arr = [] # type: T.List[str] - if self.log_timestamp_start is not None: + if self.log_timestamp_start is not None and display_timestamp: arr = ['[{:.3f}]'.format(time.monotonic() - self.log_timestamp_start)] for arg in args: if arg is None: @@ -240,21 +240,21 @@ class _Logger: print(cleaned, end='') def debug(self, *args: TV_Loggable, sep: T.Optional[str] = None, - end: T.Optional[str] = None) -> None: - arr = process_markup(args, False) + end: T.Optional[str] = None, display_timestamp: bool = True) -> None: + arr = process_markup(args, False, display_timestamp) if self.log_file is not None: print(*arr, file=self.log_file, sep=sep, end=end) self.log_file.flush() def _log(self, *args: TV_Loggable, is_error: bool = False, nested: bool = True, sep: T.Optional[str] = None, - end: T.Optional[str] = None) -> None: - arr = process_markup(args, False) + end: T.Optional[str] = None, display_timestamp: bool = True) -> None: + arr = process_markup(args, False, display_timestamp) if self.log_file is not None: print(*arr, file=self.log_file, sep=sep, end=end) self.log_file.flush() if colorize_console(): - arr = process_markup(args, True) + arr = process_markup(args, True, display_timestamp) if not self.log_errors_only or is_error: force_print(*arr, nested=nested, sep=sep, end=end) @@ -270,11 +270,12 @@ class _Logger: def log(self, *args: TV_Loggable, is_error: bool = False, once: bool = False, nested: bool = True, sep: T.Optional[str] = None, - end: T.Optional[str] = None) -> None: + end: T.Optional[str] = None, + display_timestamp: bool = True) -> None: if once: - self._log_once(*args, is_error=is_error, nested=nested, sep=sep, end=end) + self._log_once(*args, is_error=is_error, nested=nested, sep=sep, end=end, display_timestamp=display_timestamp) else: - self._log(*args, is_error=is_error, nested=nested, sep=sep, end=end) + self._log(*args, is_error=is_error, nested=nested, sep=sep, end=end, display_timestamp=display_timestamp) def log_timestamp(self, *args: TV_Loggable) -> None: if self.log_timestamp_start: @@ -282,7 +283,7 @@ class _Logger: def _log_once(self, *args: TV_Loggable, is_error: bool = False, nested: bool = True, sep: T.Optional[str] = None, - end: T.Optional[str] = None) -> None: + end: T.Optional[str] = None, display_timestamp: bool = True) -> None: """Log variant that only prints a given message one time per meson invocation. This considers ansi decorated values by the values they wrap without @@ -298,7 +299,7 @@ class _Logger: if t in self.logged_once: return self.logged_once.add(t) - self._log(*args, is_error=is_error, nested=nested, sep=sep, end=end) + self._log(*args, is_error=is_error, nested=nested, sep=sep, end=end, display_timestamp=display_timestamp) def _log_error(self, severity: _Severity, *rargs: TV_Loggable, once: bool = False, fatal: bool = True,