From 267a1783e039d4d2a460f0597932a36e9ae174ae Mon Sep 17 00:00:00 2001 From: Ian Zimmerman Date: Sun, 29 Mar 2009 20:29:34 -0400 Subject: [PATCH] (refs #454) pass a ref to the logStatus object for each logfile, for better reporting. --- buildbot/status/mail.py | 10 ++++++---- docs/buildbot.texinfo | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/buildbot/status/mail.py b/buildbot/status/mail.py index d5405ab..c4ef8dc 100644 --- a/buildbot/status/mail.py +++ b/buildbot/status/mail.py @@ -392,12 +392,14 @@ class MailNotifier(base.StatusReceiverMultiService): # name, log url, and the log contents as a list of strings. # logs = list() - for log in build.getLogs(): - stepName = log.getStep().getName() - logName = log.getName() + for logf in build.getLogs(): + logStep = logf.getStep() + stepName = logStep.getName() + logStatus, dummy = logStep.getResults() + logName = logf.getName() logs.append(('%s.%s' % (stepName, logName), '%s/steps/%s/logs/%s' % (self.status.getURLForThing(build), stepName, logName), - log.getText().splitlines())) + logf.getText().splitlines(), logStatus)) attrs = {'builderName': name, 'projectName': self.status.getProjectName(), diff --git a/docs/buildbot.texinfo b/docs/buildbot.texinfo index e0147f7..aecfc63 100644 --- a/docs/buildbot.texinfo +++ b/docs/buildbot.texinfo @@ -7660,7 +7660,7 @@ def message(attrs): text.append("") text.extend([c.asText() for c in attrs['changes']]) text.append("") - name, url, lines = attrs['logs'][-1] + name, url, lines, logstatus = attrs['logs'][-1] text.append("Last %d lines of '%s':" % (logLines, name)) text.extend(["\t%s\n" % line for line in lines[len(lines)-logLines:]]) text.append("") @@ -7687,7 +7687,7 @@ def message(attrs): if attrs['changes']: text.append('

Recent Changes:

') text.extend([c.asHTML() for c in attrs['changes']]) - name, url, lines = attrs['logs'][-1] + name, url, lines, logstatus = attrs['logs'][-1] text.append('

Last %d lines of "%s":

' % (logLines, name)) text.append('

') text.append('
'.join([line for line in lines[len(lines)-logLines:]])) @@ -7822,7 +7822,8 @@ The functions asText and asHTML return a list of strings with the above information formatted. @item logs (List of Tuples) List of tuples where each tuple contains the log name, log url, -and log contents as a list of strings. +log contents as a list of strings, and the status of the corresponding build step, +i.e. SUCCESS, WARNING, or FAILURE. @end table @end table -- 2.11.4.GIT