summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
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/lib/bb/cooker.py
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/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py8
1 files changed, 8 insertions, 0 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]