diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2018-03-26 17:45:27 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2018-04-12 18:03:09 +0000 |
commit | 7c9713add0a36cfceb3492e4a008f7e5baba36ab (patch) | |
tree | 78de391239cc7241408e9ad76dc7b2105b5ecd34 | |
parent | 522d6538410ca97627500d76f4aaca3d7b0c1608 (diff) | |
download | buildstream-7c9713add0a36cfceb3492e4a008f7e5baba36ab.tar.gz |
frontend: capture errors for later use
This will be used to provide an error summary before the pipeline summary.
-rw-r--r-- | buildstream/_frontend/widget.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py index 3d7b98733..924c0318d 100644 --- a/buildstream/_frontend/widget.py +++ b/buildstream/_frontend/widget.py @@ -19,7 +19,7 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> import datetime import os -from collections import OrderedDict +from collections import defaultdict, OrderedDict from contextlib import ExitStack from mmap import mmap import re @@ -326,6 +326,7 @@ class LogLine(Widget): super(LogLine, self).__init__(content_profile, format_profile) self.columns = [] + self._failure_messages = defaultdict(list) self.success_profile = success_profile self.err_profile = err_profile self.detail_profile = detail_profile @@ -390,6 +391,16 @@ class LogLine(Widget): def render(self, message): + # Track logfiles for later use + element_id = message.task_id or message.unique_id + if message.message_type in ERROR_MESSAGES and element_id is not None: + plugin = _plugin_lookup(element_id) + self._failure_messages[plugin].append(message) + + return self._render(message) + + def _render(self, message): + # Render the column widgets first text = '' for widget in self.columns: |