<html lang="en"> <head> <title>Reading Logfiles - BuildBot Manual - 0.8.4p1</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="BuildBot Manual - 0.8.4p1"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Writing-New-BuildSteps.html#Writing-New-BuildSteps" title="Writing New BuildSteps"> <link rel="prev" href="BuildStep-LogFiles.html#BuildStep-LogFiles" title="BuildStep LogFiles"> <link rel="next" href="Adding-LogObservers.html#Adding-LogObservers" title="Adding LogObservers"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- This is the BuildBot manual for Buildbot version 0.8.4p1. Copyright (C) 2005, 2006, 2009, 2010 Brian Warner Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.--> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Reading-Logfiles"></a> <p> Next: <a rel="next" accesskey="n" href="Adding-LogObservers.html#Adding-LogObservers">Adding LogObservers</a>, Previous: <a rel="previous" accesskey="p" href="BuildStep-LogFiles.html#BuildStep-LogFiles">BuildStep LogFiles</a>, Up: <a rel="up" accesskey="u" href="Writing-New-BuildSteps.html#Writing-New-BuildSteps">Writing New BuildSteps</a> <hr> </div> <h5 class="subsubsection">4.12.13.3 Reading Logfiles</h5> <p>Once a LogFile has been added to a BuildStep with <code>addLog()</code>, <code>addCompleteLog()</code>, <code>addHTMLLog()</code>, or <code>logfiles=</code>, your BuildStep can retrieve it by using <code>getLog()</code>: <pre class="example"> 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 </pre> <p>For a complete list of the methods you can call on a LogFile, please see the docstrings on the <code>IStatusLog</code> class in <samp><span class="file">buildbot/interfaces.py</span></samp>. </body></html>