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

Ravindra Parihar imravin at gmail.com
Wed Apr 14 13:26:24 UTC 2010


def getCustomMesgData(self, mode, name, build, results, master_status):
       #
       # logs is a list of tuples that contain the log
       # name, log url, and the log contents as a list of strings.
       #
       logs = list()
       for logf in build.getLogs():
           logStep = logf.getStep()
           stepName = logStep.getName()
           logStatus, dummy = logStep.getResults()
           logName = logf.getName()
           logs.append(('%s.%s' % (stepName, logName),
                        '%s/steps/%s/logs/%s' %
(master_status.getURLForThing(build), stepName, logName),
                      logf.getText().splitlines(),'\n'.join(loglines[-10:]),
                        logStatus))


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.
>
> Please help.
>
> Regards,
> Ravi
>
> 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
>>
>>
>>
------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> 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/20100414/1614c3f8/attachment.html>


More information about the devel mailing list