Next: , Previous: BuildStep LogFiles, Up: Writing New BuildSteps


4.11.11.3 Reading Logfiles

Once a LogFile has been added to a BuildStep with addLog(), addCompleteLog(), addHTMLLog(), or logfiles=, your BuildStep can retrieve it by using getLog():

     class MyBuildStep(ShellCommand):
         logfiles = { "nodelog": "_test/node.log" }
     
         def evaluateCommand(self, cmd):
             nodelog = self.getLog("nodelog")
             if "STARTED" in nodelog.getText():
                 return SUCCESS
             else:
                 return FAILURE

For a complete list of the methods you can call on a LogFile, please see the docstrings on the IStatusLog class in buildbot/interfaces.py.