[bitbake-devel] How to determine a flowId for log messages?

Chris Larson clarson at kergoth.com
Wed May 15 19:18:11 UTC 2013

On Wed, May 15, 2013 at 10:54 AM, Francois Retief <fgretief at gmail.com>wrote:

> At work we use TeamCity [1] as our CI server.  I have written a small
> patch (attached to email) to extend bitbake to output log messages in
> TeamCity's Service Message format [2]. This allow us to better communicate
> warnings and errors to the server.
> I did this by overriding the BBLogFormatter class in knotty.py. The output
> is formatted with timestamp, text, errorDetails and status fields so that
> the TeamCity server can augment the logs with color and terminate if errors
> occur.
> TeamCity also has a *flowId* field that is used as a unique identifier to
> distinguish between separate processes running in parallel. On the server,
> all messages with the same *flowId* is grouped together. I would like to
> use it with bitbake.
> What bitbake logging attribute do I need to monitor to determine the *
> flowId* of a message?
> I tried to use the taskId attribute in the logging record, but most of the
> time it is set to either zero or not there at all.
>         if hasattr(record, 'taskpid') and record.taskpid != 0:
>             msg += " flowId='%s'" % record.taskpid
> Are there any other way to identify log messages for grouping them
> together?
> Or any alternative methods? Am I on the right track,
> or do I need to write a whole new ui for this?

'pid' on events and 'taskpid' on log records should always correspond to
the process id of the spawned task. If it's not set, then it's likely that
log message wasn't recorded in task context, but elsewhere, e.g. from an
event handler, or general global log messages. Afaik. See msg.py and
event.py, as well as fork_off_task in the runqueue for details.
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20130515/e7fc7849/attachment-0001.html>

More information about the bitbake-devel mailing list