From c23c015cf8af1868faf293b19b80a5faf7e736a5 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 10 Jun 2010 08:05:52 -0700 Subject: 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 --- bin/bitbake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin/bitbake') diff --git a/bin/bitbake b/bin/bitbake index 06198c45a..67cc9d594 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -160,7 +160,8 @@ Default BBFILES are the .bb files in the current directory.""") configuration = BBConfiguration(options) configuration.pkgs_to_build.extend(args[1:]) - logger.addHandler(event.LogHandler()) + loghandler = event.LogHandler() + logger.addHandler(loghandler) #server = bb.server.xmlrpc server = bb.server.none @@ -186,6 +187,8 @@ Default BBFILES are the .bb files in the current directory.""") server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile) del cooker + logger.removeHandler(loghandler) + # Setup a connection to the server (cooker) serverConnection = server.BitBakeServerConnection(serverinfo) -- cgit 1.2.3-korg