summaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-02-08 13:41:36 -0700
committerChris Larson <chris_larson@mentor.com>2011-02-08 13:42:19 -0700
commit3539c9474a0b53f57e614544c70a7197ecdfb130 (patch)
tree9c89416a0bdd10417af836fd02dbada2be2a381d /lib/bb/event.py
parentd93fcbd64ab5d806288424170f55323b4297e7d6 (diff)
downloadbitbake-3539c9474a0b53f57e614544c70a7197ecdfb130.tar.gz
Shift traceback pre-formatting into LogHandler
It's cleaner to leave it behaving as usual, passing the exception data in the exc_info attribute of the LogRecord where it normally lies, and then let LogHandler make it pickleable so it can be sent to the UI. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index c22a5910b..e76a82a93 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -30,6 +30,7 @@ except ImportError:
import pickle
import logging
import atexit
+import traceback
import bb.utils
# This is the pid for which we should generate the event. This is set when
@@ -379,6 +380,9 @@ class LogHandler(logging.Handler):
"""Dispatch logging messages as bitbake events"""
def emit(self, record):
+ if record.exc_info:
+ record.msg += '\n%s' % traceback.format_exception(*record.exc_info)
+ record.exc_info = None
fire(record, None)
def filter(self, record):