[Buildbot-devel] Attaching a LogObserver. What's wrong here? Example similar to VisualStudio step

Francesco Di Mizio francescodimizio at gmail.com
Fri Feb 27 18:12:18 UTC 2015

class MyLogLineObserver(LogLineObserver):

stdoutDelimiter = "\r\n"
stderrDelimiter = "\r\n"

_re_delimiter = re.compile(r'^(\d+>)?-{5}.+-{5}$')
_re_file = re.compile(r'^(\d+>)?[^ ]+\.(cpp|c)$')
_re_error = re.compile(r' ?error ([A-Z]+[0-9]+)?\s?: ')

nbFiles = 0
nbErrors = 0
 logerrors = None

def __init__(self, logerrors, **kwargs):
LogLineObserver.__init__(self, **kwargs)
self.logerrors = logerrors

def outLineReceived(self, line):
log.msg('line %s' %line)

class MyCustomStep(ShellCommand):

    logobserver = None

    # Skip many lines
    def setupLogfiles(self, cmd, logfiles):
logerrors = self.addLog("errors")
buildlog = self.addLogFile('build', 'build.log')
self.logobserver = MyLogLineObserver(logerrors)
self.addLogObserver('buildlog', self.logobserver)
ShellCommand.setupLogfiles(self, cmd, logfiles)

Basically what happens is that I rightly end up with 3 logs: stdio, errors
and build. The build link from the web UI gets populated ok.
I'd expect  MyLogLineObserver to watch build.log and as it does so I should
be getting those lines because of log.msg('line %s' %line)

Well that's not happening. On the other end, when I attach
MyLogLineObserver to stdio (which always exists) I can see thos eline being
dumped to twisted.log.  In other words self.addLogObserver('buildlog',
self.logobserver) does NOT work, self.addLogObserver('stdio',
self.logobserver) DOES work.

Am I doing somethign wrong?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150227/e38ca043/attachment.html>

More information about the devel mailing list