mirror of
https://git.yoctoproject.org/poky
synced 2026-04-19 15:32:13 +02:00
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: 3bad17c8cf58b2bfc36a1de754fa47fb344bd5d8) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2f1ea25c222b344dd8b784b2bc73a6540ab30274) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
990c499176
commit
59ad5783a5
@@ -481,7 +481,8 @@ class ThreadedWorker(Thread):
|
||||
try:
|
||||
func(self, *args, **kargs)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
# Eat all exceptions
|
||||
bb.mainlogger.debug("Worker task raised %s" % e, exc_info=e)
|
||||
finally:
|
||||
self.tasks.task_done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user