summaryrefslogtreecommitdiffstats
path: root/lib/bb/__init__.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-01-10 09:20:50 -0700
committerChris Larson <chris_larson@mentor.com>2011-01-10 11:55:49 -0700
commit0153ace246e7c88366f45c8f035a2b4505a1c115 (patch)
treef9bbcc1eb4cbf5d49bd9e43dc2e5ebf8a42b7423 /lib/bb/__init__.py
parentde2518ab761d4c1a37d1d5d1d2224b0451e84e5f (diff)
downloadopenembedded-core-contrib-0153ace246e7c88366f45c8f035a2b4505a1c115.tar.gz
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. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/__init__.py')
-rw-r--r--lib/bb/__init__.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index ba5061e6ff..572d5b31c3 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -35,11 +35,6 @@ class NullHandler(logging.Handler):
def emit(self, record):
pass
-class BBLogRecord(logging.LogRecord):
- def __init__(self, name, level, fn, lno, msg, args, exc_info, func, extra):
- self.taskpid = bb.event.worker_pid
- logging.LogRecord.__init__(self, name, level, fn, lno, msg, args, exc_info, func)
-
Logger = logging.getLoggerClass()
class BBLogger(Logger):
def __init__(self, name):
@@ -47,9 +42,6 @@ class BBLogger(Logger):
self.debug = self.bbdebug
Logger.__init__(self, name)
- def makeRecord(self, name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None):
- return BBLogRecord(name, lvl, fn, lno, msg, args, exc_info, func, extra)
-
def bbdebug(self, level, msg, *args, **kwargs):
return self.log(logging.DEBUG - level - 1, msg, *args, **kwargs)