[Buildbot-devel] HTML logs

Chris Heisterkamp chris.heisterkamp at airplaynetwork.com
Thu Jan 25 00:33:09 UTC 2007


I have a build step that generates an html log.

I added the html file to the logfiles of the buildstep but the buildstep 
escapes the html and presents it as text

f.addStep(HtmlReport,
          command=['ant', 'html-report'],
          logfiles={'textreport':'reports/html/report.html'})


In order to get the unescaped html report I overrode the commandComplete 
method of HtmlReport to add a new html log to the buildstep

class HtmlReport(ShellCommand):
    def commandComplete(self, cmd):
        textlog = cmd.logs['textreport']
        contents = textlog.getText()
        self.addHTMLLog('htmlreport', contents)


This gives me the html report I want but I still have the extra 
'textreport' log on the build step which isn't pretty.

I'm curious how other people have dealt this problem and if there is a 
better way to do this?

I briefly looked at modifiying  setupLogfiles() in  the LoggingBuildStep 
to add an html log if the extension of the file was 'htm' or 'html', but 
it there is only a method for adding a complete HTML log.

Is there an easy modification to LogFile that will give back the body as 
unescaped html instead?

Regards,
    Chris











More information about the devel mailing list