[Buildbot-devel] [Buildbot]how to attach Only few nos of lines in attached logfile

Ravindra Parihar imravin at gmail.com
Thu Apr 15 10:02:09 UTC 2010


The below link will only cut the triallog and show the logs in the buildbot
link.
http://djmitche.github.com/buildbot/docs/0.8.0beta1/MailNotifier.html#MailNotifier

But I want the logfile as an attachment and logfile should contain only few
lines.

If anyone have any other idea please share with us.

Thanks/
Ravi





On Wed, Apr 14, 2010 at 8:06 PM, tom fogal <tfogal at alumni.unh.edu> wrote:

> Ravindra Parihar <imravin at gmail.com> writes:
> > def getCustomMesgData(self, mode, name, build, results, master_status):
> [snip]
> > On Wed, Apr 14, 2010 at 6:52 PM, Ravindra Parihar <imravin at gmail.com>
> wrote:
> > > I am not aware of python :( so not getting where to use
> > > "'\n'.join(loglines[-10:])" exactly.
> > > I tried to use it in buildbot/status/mail.py script at 291 line but
> > > it not showing any difference to the output.
> > >
> > > May be I am not using it correctly.
>
> There is a detailed solution to this problem in the documentation.
> See:
>
>
> http://djmitche.github.com/buildbot/docs/0.8.0beta1/MailNotifier.html#MailNotifier
>
> in particular, look at the "message_formatter" function it defines.
>
> -tom
>
> > > On Wed, Apr 14, 2010 at 2:35 PM, Marcus Lindblom <macke at yar.nu> wrote:
> > >> On 2010-04-14 10:05, Ravindra Parihar wrote:
> > >>> Hi All,
> > >>>
> > >>> I only want few no. of lines in the log file after the build
> > >>> completion. Currently I am receiving log of 1 MB which is too high.
> > >>>
> > >>> Please suggest how we can cut the no. of lines in the log file and
> > >>> attach to the mail.
> > >>
> > >> I add the log files inline in the mail using python slice syntax.
> > >>
> > >> I.e. to get last 10 lines of a file with line-breaks between:
> > >>
> > >>  '\n'.join(loglines[-10:])
> > >>
> > >> Cheers,
> > >> /Marcus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20100415/f32983f9/attachment.html>


More information about the devel mailing list