path: root/meta/lib/oe
diff options
authorRoss Burton <>2021-10-14 16:33:18 (GMT)
committerRichard Purdie <>2021-10-18 12:48:16 (GMT)
commitf59811aeeb1fe7048c177c9ff0268bfc1a521b96 (patch)
tree235b01e5bbc9ff079cf7933261920029861c7002 /meta/lib/oe
parent4359dba4febb40c87c8bb47c42f94d0204f41844 (diff)
oe/utils: log exceptions in ThreadedWorker functions
If the function a ThreadedWorker is executing raises an exception, don't use print() as that mostly disappears. Instead, output it to the logger. This is done using bb.mainlogger.debug directly instead of bb.debug() as this allows us to pass the exception instance directly, which is then incorporated into the log stream. (From OE-Core rev: 2f1ea25c222b344dd8b784b2bc73a6540ab30274) Signed-off-by: Ross Burton <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'meta/lib/oe')
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oe/ b/meta/lib/oe/
index 238af31..cf65639 100644
--- a/meta/lib/oe/
+++ b/meta/lib/oe/
@@ -508,7 +508,8 @@ class ThreadedWorker(Thread):
508 try: 508 try:
509 func(self, *args, **kargs) 509 func(self, *args, **kargs)
510 except Exception as e: 510 except Exception as e:
511 print(e) 511 # Eat all exceptions
512 bb.mainlogger.debug("Worker task raised %s" % e, exc_info=e)
512 finally: 513 finally:
513 self.tasks.task_done() 514 self.tasks.task_done()
514 515