From 69aab78dd830b0ad570cf9b7bfe2da8e8b793e23 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 23 Aug 2013 16:16:50 +0000 Subject: bitbake: bitbake: Add ui event handlers filtering Add functionality to allow UIs to update and change the types of events they recieve. To do this we need to add a new command and also need to be able to obtain the current event hander ID. In the case of xmlrpc, this is straightforward, in the case of the process server we need to save the result in a multiprocessing.Value() so we can retrive it. An excplit command was added to the server API to facilitate this. The same function can also be used to mask or unmask specific log messages, allowing the UI to optionally differ from the standard set of message filtering. Based upon work by Cristiana Voicu (Bitbake rev: ba5a6c88785d9889d4172ec79937ac2a5555327e) Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/knotty.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bitbake/lib/bb/ui/knotty.py') diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 09ad99ebe8..1692e3295c 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -232,6 +232,15 @@ def _log_settings_from_server(server): raise BaseException(error) return includelogs, loglines, consolelogfile +_evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.LogRecord", + "bb.build.TaskFailed", "bb.build.TaskBase", "bb.event.ParseStarted", + "bb.event.ParseProgress", "bb.event.ParseCompleted", "bb.event.CacheLoadStarted", + "bb.event.CacheLoadProgress", "bb.event.CacheLoadCompleted", "bb.command.CommandFailed", + "bb.command.CommandExit", "bb.command.CommandCompleted", "bb.cooker.CookerExit", + "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted", + "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed", + "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent"] + def main(server, eventHandler, params, tf = TerminalFilter): includelogs, loglines, consolelogfile = _log_settings_from_server(server) @@ -262,6 +271,9 @@ def main(server, eventHandler, params, tf = TerminalFilter): consolelog.setFormatter(conlogformat) logger.addHandler(consolelog) + llevel, debug_domains = bb.msg.constructLogOptions() + server.runCommand(["setEventMask", server.getEventHandle(), llevel, debug_domains, _evt_list]) + if not params.observe_only: params.updateFromServer(server) cmdline = params.parseActions() -- cgit v1.2.3-54-g00ecf