diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-03-10 14:19:48 -0500 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2021-03-22 21:29:14 -0400 |
commit | 8cd4d0b2832666f19660b9006040e5ff7e5d4576 (patch) | |
tree | e649e579f16f81c9ce6380fa3f1f78b2120bea91 | |
parent | 7c3418204f824a613c67e7ccd06ef6983656e904 (diff) | |
download | meson-8cd4d0b2832666f19660b9006040e5ff7e5d4576.zip meson-8cd4d0b2832666f19660b9006040e5ff7e5d4576.tar.gz meson-8cd4d0b2832666f19660b9006040e5ff7e5d4576.tar.bz2 |
mlog: Do not print 'subproject|' for the message 'Executing subproject'
It already contains the full callstack and it's more visible when it's
standing on its own line.
-rw-r--r-- | mesonbuild/interpreter.py | 12 | ||||
-rw-r--r-- | mesonbuild/mlog.py | 7 |
2 files changed, 9 insertions, 10 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 8653b38..4dcb48c 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2911,13 +2911,11 @@ external dependencies (including libraries) must go to "dependencies".''') os.makedirs(os.path.join(self.build.environment.get_build_dir(), subdir), exist_ok=True) self.global_args_frozen = True - mlog.log() - with mlog.nested(subp_name): - stack = ':'.join(self.subproject_stack + [subp_name]) - m = ['Executing subproject', mlog.bold(stack)] - if method != 'meson': - m += ['method', mlog.bold(method)] - mlog.log(*m,'\n') + stack = ':'.join(self.subproject_stack + [subp_name]) + m = ['\nExecuting subproject', mlog.bold(stack)] + if method != 'meson': + m += ['method', mlog.bold(method)] + mlog.log(*m,'\n', nested=False) try: if method == 'meson': diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index c51922a..38a4805 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -201,7 +201,7 @@ def process_markup(args: T.Sequence[T.Union[AnsiDecorator, str]], keep: bool) -> arr.append(str(arg)) return arr -def force_print(*args: str, **kwargs: T.Any) -> None: +def force_print(*args: str, nested: str, **kwargs: T.Any) -> None: if log_disable_stdout: return iostr = io.StringIO() @@ -210,7 +210,7 @@ def force_print(*args: str, **kwargs: T.Any) -> None: raw = iostr.getvalue() if log_depth: - prepend = log_depth[-1] + '| ' + prepend = log_depth[-1] + '| ' if nested else '' lines = [] for l in raw.split('\n'): l = l.strip() @@ -250,6 +250,7 @@ def log(*args: T.Union[str, AnsiDecorator], is_error: bool = False, def _log(*args: T.Union[str, AnsiDecorator], is_error: bool = False, **kwargs: T.Any) -> None: + nested = kwargs.pop('nested', True) arr = process_markup(args, False) if log_file is not None: print(*arr, file=log_file, **kwargs) @@ -257,7 +258,7 @@ def _log(*args: T.Union[str, AnsiDecorator], is_error: bool = False, if colorize_console(): arr = process_markup(args, True) if not log_errors_only or is_error: - force_print(*arr, **kwargs) + force_print(*arr, nested=nested, **kwargs) def log_once(*args: T.Union[str, AnsiDecorator], is_error: bool = False, **kwargs: T.Any) -> None: |