diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/build.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 7a7aabb853..0c2c1ba126 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -562,6 +562,7 @@ def _exec_task(fn, task, d, quieterr): localdata.setVar('BB_LOGFILE', logfn) localdata.setVar('BB_RUNTASK', task) + localdata.setVar('BB_TASK_LOGGER', bblogger) flags = localdata.getVarFlags(task) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 9073f15ea2..a22a05e241 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -1503,3 +1503,14 @@ def load_plugins(logger, plugins, pluginpath): plugins.append(obj or plugin) else: plugins.append(plugin) + + +class LogCatcher(logging.Handler): + """Logging handler for collecting logged messages so you can check them later""" + def __init__(self): + self.messages = [] + logging.Handler.__init__(self, logging.WARNING) + def emit(self, record): + self.messages.append(bb.build.logformatter.format(record)) + def contains(self, message): + return (message in self.messages) |