mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 09:32:14 +02:00
Use logging in the knotty ui, and pass the log record across directly
This kills firing of Msg* events in favor of just passing along LogRecord objects. These objects hold more than just level and message, but can also have exception information, so the UI can decide what to do with that. As an aside, when using the 'none' server, this results in the log messages in the server being displayed directly via the logging module and the UI's handler, rather than going through the server's event queue. As a result of doing it this way, we have to override the event handlers of the base logger when spawning a worker process, to ensure they log via events rather than directly. (Bitbake rev: c23c015cf8af1868faf293b19b80a5faf7e736a5) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
4855548ffb
commit
d3a45c7d41
@@ -24,11 +24,14 @@ Handles preparation and execution of a queue of tasks
|
||||
|
||||
import bb, os, sys
|
||||
import subprocess
|
||||
from bb import msg, data, event
|
||||
import signal
|
||||
import stat
|
||||
import fcntl
|
||||
import copy
|
||||
import logging
|
||||
from bb import msg, data, event
|
||||
|
||||
bblogger = logging.getLogger("BitBake")
|
||||
|
||||
try:
|
||||
import cPickle as pickle
|
||||
@@ -1127,6 +1130,11 @@ class RunQueueExecute:
|
||||
bb.event.worker_pipe = pipeout
|
||||
bb.event.useStdout = False
|
||||
|
||||
# Child processes should send their messages to the UI
|
||||
# process via the server process, not print them
|
||||
# themselves
|
||||
bblogger.handlers = [bb.event.LogHandler()]
|
||||
|
||||
self.rq.state = runQueueChildProcess
|
||||
# Make the child the process group leader
|
||||
os.setpgid(0, 0)
|
||||
|
||||
Reference in New Issue
Block a user