summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2018-03-26 17:49:31 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2018-04-12 14:39:45 +0100
commitb7c015b3c662793c1cbd5b48cd6ef61719367e64 (patch)
tree332c0eb52c0a71a22f3866a118f7f87203a9e9af
parent144a5cc92456a81da316f9c03dc31d067fc47e06 (diff)
downloadbuildstream-b7c015b3c662793c1cbd5b48cd6ef61719367e64.tar.gz
frontend: Summarise build log output in --no-verbose mode
-rw-r--r--buildstream/_frontend/widget.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index 4d4f11380..7b5ade005 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -328,6 +328,7 @@ class LogLine(Widget):
self.columns = []
self._failure_messages = defaultdict(list)
+ self._context = None
self.success_profile = success_profile
self.err_profile = err_profile
self.detail_profile = detail_profile
@@ -390,6 +391,8 @@ class LogLine(Widget):
self.space_widget.size_request(pipeline)
self.logfile_widget.size_request(pipeline)
+ self._context = pipeline.context
+
def render(self, message):
# Track logfiles for later use
@@ -458,16 +461,21 @@ class LogLine(Widget):
if message.scheduler and message.message_type == MessageType.FAIL:
text += '\n'
- text += self.indent + self.err_profile.fmt("Printing the last {} lines from log file:"
- .format(self.log_lines)) + '\n'
- text += self.indent + self.logfile_widget.render(message, abbrev=False) + '\n'
- text += self.indent + self.err_profile.fmt("=" * 70) + '\n'
-
- log_content = self.read_last_lines(message.logfile)
- log_content = textwrap.indent(log_content, self.indent)
- text += self.detail_profile.fmt(log_content)
- text += '\n'
- text += self.indent + self.err_profile.fmt("=" * 70) + '\n'
+
+ if self._context is not None and not self._context.log_verbose:
+ text += self.indent + self.err_profile.fmt("Log file: ")
+ text += self.indent + self.logfile_widget.render(message) + '\n'
+ else:
+ text += self.indent + self.err_profile.fmt("Printing the last {} lines from log file:"
+ .format(self.log_lines)) + '\n'
+ text += self.indent + self.logfile_widget.render(message, abbrev=False) + '\n'
+ text += self.indent + self.err_profile.fmt("=" * 70) + '\n'
+
+ log_content = self.read_last_lines(message.logfile)
+ log_content = textwrap.indent(log_content, self.indent)
+ text += self.detail_profile.fmt(log_content)
+ text += '\n'
+ text += self.indent + self.err_profile.fmt("=" * 70) + '\n'
extra_nl = True
if extra_nl: