summaryrefslogtreecommitdiffstats
path: root/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-10 08:05:52 -0700
committerChris Larson <chris_larson@mentor.com>2010-08-27 11:38:19 -0700
commitc23c015cf8af1868faf293b19b80a5faf7e736a5 (patch)
tree4f735f24f099c5a039c6302bdb12421cc9ad604e /lib/bb/runqueue.py
parent47ca82397bc395b598c6b68b24cdee9e0d8a76d8 (diff)
downloadbitbake-c23c015cf8af1868faf293b19b80a5faf7e736a5.tar.gz
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. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/runqueue.py')
-rw-r--r--lib/bb/runqueue.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 0645d0699..4010dadf7 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -23,10 +23,13 @@ Handles preparation and execution of a queue of tasks
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb, os, sys
-from bb import msg, data, event
import signal
import stat
import fcntl
+import logging
+from bb import msg, data, event
+
+bblogger = logging.getLogger("BitBake")
class TaskFailure(Exception):
"""Exception raised when a task in a runqueue fails"""
@@ -1075,6 +1078,11 @@ class RunQueue:
bb.event.worker_pid = os.getpid()
bb.event.worker_pipe = pipeout
+ # Child processes should send their messages to the UI
+ # process via the server process, not print them
+ # themselves
+ bblogger.handlers = [bb.event.LogHandler()]
+
self.state = runQueueChildProcess
# Make the child the process group leader
os.setpgid(0, 0)