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.
pull/7491/head
Xavier Claessens 4 years ago
parent 7c3418204f
commit 8cd4d0b283
  1. 12
      mesonbuild/interpreter.py
  2. 7
      mesonbuild/mlog.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':

@ -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:

Loading…
Cancel
Save