summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-14 14:29:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-15 06:59:44 +0100
commit8e7282c0320c95cacf14aee450c950f0a10b7999 (patch)
treece8abe566f03747418ee6b94be03a848e7e099e7 /bitbake
parent1131303ec4997885418f502138b68fa89c2b9f78 (diff)
downloadpoky-8e7282c0320c95cacf14aee450c950f0a10b7999.tar.gz
bitbake: cooker/knotty: Prefix parse logs with filename being parsed
We now prefix log messages coming from worker task context with the PF and task info, however parsing messages all have to be manually prefixed which is ugly and error prone. This change modifies the log handler filter so this happens automatically, meaning we don't have to change every message to include that information. This makes error messages longer but more usable. (Bitbake rev: 1af0ccaac81e182c4ca520037dda362d180e5605) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py8
-rw-r--r--bitbake/lib/bb/ui/knotty.py3
2 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 4068b8f9b3..9b565fc37d 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1970,9 +1970,17 @@ class Parser(multiprocessing.Process):
1970 1970
1971 def parse(self, filename, appends, caches_array): 1971 def parse(self, filename, appends, caches_array):
1972 try: 1972 try:
1973 # Record the filename we're parsing into any events generated
1974 def parse_filter(self, record):
1975 record.taskpid = bb.event.worker_pid
1976 record.fn = filename
1977 return True
1978
1973 # Reset our environment and handlers to the original settings 1979 # Reset our environment and handlers to the original settings
1974 bb.utils.set_context(self.context.copy()) 1980 bb.utils.set_context(self.context.copy())
1975 bb.event.set_class_handlers(self.handlers.copy()) 1981 bb.event.set_class_handlers(self.handlers.copy())
1982 bb.event.LogHandler.filter = parse_filter
1983
1976 return True, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array) 1984 return True, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array)
1977 except Exception as exc: 1985 except Exception as exc:
1978 tb = sys.exc_info()[2] 1986 tb = sys.exc_info()[2]
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index dff92bce91..2fc20cfb53 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -371,7 +371,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):
371 if event.taskpid in helper.running_tasks: 371 if event.taskpid in helper.running_tasks:
372 taskinfo = helper.running_tasks[event.taskpid] 372 taskinfo = helper.running_tasks[event.taskpid]
373 event.msg = taskinfo['title'] + ': ' + event.msg 373 event.msg = taskinfo['title'] + ': ' + event.msg
374 374 if hasattr(event, 'fn'):
375 event.msg = event.fn + ': ' + event.msg
375 logger.handle(event) 376 logger.handle(event)
376 continue 377 continue
377 378