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

Francesco Di Mizio francescodimizio at gmail.com
Sun Mar 1 20:46:16 UTC 2015


Thanks Dustin, you are problably right. I thought I was to pass in the var
name of the log object, not the string.

Cheers,
 Francesco

On Sun, Mar 1, 2015 at 4:16 AM, Dustin J. Mitchell <dustin at v.igoro.us>
wrote:

> It looks like you're calling the log both 'build' and 'buildlog'.
>
> Dustin
>
> On Fri, Feb 27, 2015 at 1:12 PM, Francesco Di Mizio
> <francescodimizio at gmail.com> wrote:
> > 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?
> >
> > Cheers,
> >  Francesco
> >
> >
> ------------------------------------------------------------------------------
> > Dive into the World of Parallel Programming The Go Parallel Website,
> > sponsored
> > by Intel and developed in partnership with Slashdot Media, is your hub
> for
> > all
> > things parallel software development, from weekly thought leadership
> blogs
> > to
> > news, videos, case studies, tutorials and more. Take a look and join the
> > conversation now. http://goparallel.sourceforge.net/
> > _______________________________________________
> > Buildbot-devel mailing list
> > Buildbot-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/buildbot-devel
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150301/630b5ad4/attachment.html>


More information about the devel mailing list