From 810e139fd3626acdf23372426526bceb7ccb1abf Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Mon, 10 Jan 2011 09:20:50 -0700 Subject: Inject taskpid into log records via our log handler It turns out that while log filters added with addFilter are only associated with that logger, and not its children, handlers are inherited, and handlers can be filters. So, let's add filtering to our existing LogHandler class which dispatches our log records as bitbake events. (Bitbake rev: 0153ace246e7c88366f45c8f035a2b4505a1c115) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/event.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bitbake/lib/bb/event.py') diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 450d913633..bd2042a99c 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py @@ -384,3 +384,7 @@ class LogHandler(logging.Handler): fire(record, None) if bb.event.useStdout: print(self.format(record)) + + def filter(self, record): + record.taskpid = worker_pid + return True -- cgit v1.2.3-54-g00ecf