diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2018-03-26 17:49:31 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2018-04-12 18:03:09 +0000 |
commit | 7b0a96564f4ec5105fdcc5dd440656ba29599ea2 (patch) | |
tree | 786ab157e0855a5dcda4b1c57462564bb70a122f | |
parent | 30af44e86bbf44df91fa2acf63da1e70ced33257 (diff) | |
download | buildstream-7b0a96564f4ec5105fdcc5dd440656ba29599ea2.tar.gz |
frontend: Summarise build log output in --no-verbose mode
-rw-r--r-- | buildstream/_frontend/widget.py | 28 |
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: |