summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-10 08:05:52 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:33 +0000
commitd3a45c7d41a88d79389fc40eb68816e4939fb6f9 (patch)
tree443e2828e6d5e86f59b8b238607ef38646c1f23f /bitbake/lib/bb/runqueue.py
parent4855548ffbbb6b972f6b71d61d2b29e4758acdc7 (diff)
downloadpoky-d3a45c7d41a88d79389fc40eb68816e4939fb6f9.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. (Bitbake rev: c23c015cf8af1868faf293b19b80a5faf7e736a5) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index be873ff7dc..94b456a988 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -24,11 +24,14 @@ Handles preparation and execution of a queue of tasks
24 24
25import bb, os, sys 25import bb, os, sys
26import subprocess 26import subprocess
27from bb import msg, data, event
28import signal 27import signal
29import stat 28import stat
30import fcntl 29import fcntl
31import copy 30import copy
31import logging
32from bb import msg, data, event
33
34bblogger = logging.getLogger("BitBake")
32 35
33try: 36try:
34 import cPickle as pickle 37 import cPickle as pickle
@@ -1127,6 +1130,11 @@ class RunQueueExecute:
1127 bb.event.worker_pipe = pipeout 1130 bb.event.worker_pipe = pipeout
1128 bb.event.useStdout = False 1131 bb.event.useStdout = False
1129 1132
1133 # Child processes should send their messages to the UI
1134 # process via the server process, not print them
1135 # themselves
1136 bblogger.handlers = [bb.event.LogHandler()]
1137
1130 self.rq.state = runQueueChildProcess 1138 self.rq.state = runQueueChildProcess
1131 # Make the child the process group leader 1139 # Make the child the process group leader
1132 os.setpgid(0, 0) 1140 os.setpgid(0, 0)