summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index f8577c6794..9c57c65f8d 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -35,6 +35,11 @@ class NullHandler(logging.Handler):
35 def emit(self, record): 35 def emit(self, record):
36 pass 36 pass
37 37
38class BBLogRecord(logging.LogRecord):
39 def __init__(self, name, level, fn, lno, msg, args, exc_info, func, extra):
40 self.taskpid = bb.event.worker_pid
41 logging.LogRecord.__init__(self, name, level, fn, lno, msg, args, exc_info, func)
42
38Logger = logging.getLoggerClass() 43Logger = logging.getLoggerClass()
39class BBLogger(Logger): 44class BBLogger(Logger):
40 def __init__(self, name): 45 def __init__(self, name):
@@ -42,6 +47,9 @@ class BBLogger(Logger):
42 self.debug = self.bbdebug 47 self.debug = self.bbdebug
43 Logger.__init__(self, name) 48 Logger.__init__(self, name)
44 49
50 def makeRecord(self, name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None):
51 return BBLogRecord(name, lvl, fn, lno, msg, args, exc_info, func, extra)
52
45 def bbdebug(self, level, msg, *args, **kwargs): 53 def bbdebug(self, level, msg, *args, **kwargs):
46 return self.log(logging.DEBUG - level - 1, msg, *args, **kwargs) 54 return self.log(logging.DEBUG - level - 1, msg, *args, **kwargs)
47 55