<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 15, 2013 at 10:54 AM, Francois Retief <span dir="ltr"><<a href="mailto:fgretief@gmail.com" target="_blank">fgretief@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div>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.<br>
<br></div>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.<br>
<br></div>TeamCity also has a <b>flowId</b> field that is used as a unique identifier to distinguish between separate processes running in parallel. On the server, all messages with the same <b>flowId</b> is grouped together. I would like to use it with bitbake.<br>
<br></div><div>What bitbake logging attribute do I need to monitor to determine the <b>flowId</b> of a message?<br><br></div><div>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. <br>
<br></div> if hasattr(record, 'taskpid') and record.taskpid != 0:<br><div> msg += " flowId='%s'" % record.taskpid<br></div><div><br></div><div>Are there any other way to identify log messages for grouping them together?<br>
</div><div><br>Or any alternative methods? Am I on the right track, <br>or do I need to write a whole new ui for this?</div></blockquote></div><br>'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.<br>
-- <br>Christopher Larson</div></div>