From 8101b0ddab1dea8de3b2588a4b75da525865c404 Mon Sep 17 00:00:00 2001 From: Xavier Claessens <xavier.claessens@collabora.com> Date: Tue, 25 Feb 2020 10:29:47 -0500 Subject: summary: Add more info in Subprojects section This adds a warnings counter for subprojects that passed. This is to encourage developpers to check warnings in the logs and hopefully fix them. Otherwise they could be hidden in hundreds lines of logs. This also print the error message for subprojects that did not pass. The error message is often enough to fix the issue (e.g. missing dependency) and it's easier than searching in the logs why a subproject failed. --- mesonbuild/mlog.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mesonbuild/mlog.py') diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index b28eca1..ecd93f3 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -59,6 +59,7 @@ log_disable_stdout = False # type: bool log_errors_only = False # type: bool _in_ci = 'CI' in os.environ # type: bool _logged_once = set() # type: T.Set[T.Tuple[str, ...]] +log_warnings_counter = 0 # type: int def disable() -> None: global log_disable_stdout @@ -254,6 +255,9 @@ def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], else: log(*args, **kwargs) + global log_warnings_counter + log_warnings_counter += 1 + if log_fatal_warnings: raise MesonException("Fatal warnings enabled, aborting") -- cgit v1.1