diff options
-rw-r--r-- | mesonbuild/mlog.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index c7d5865..c51922a 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -211,7 +211,11 @@ def force_print(*args: str, **kwargs: T.Any) -> None: raw = iostr.getvalue() if log_depth: prepend = log_depth[-1] + '| ' - raw = prepend + raw.replace('\n', '\n' + prepend, raw.count('\n') - 1) + lines = [] + for l in raw.split('\n'): + l = l.strip() + lines.append(prepend + l if l else '') + raw = '\n'.join(lines) # _Something_ is going to get printed. try: |