summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/event.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-05-05 17:43:38 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-08 20:38:25 +0100
commit96e2ee1d730fa19665cca34c2cc3deb3fa5dfd2d (patch)
tree9c75b5c023be0bb02681d09cf42b1d4f358364c4 /bitbake/lib/bb/event.py
parenta3efbb96f23a222c58f2f4114a75d2f98d7da11f (diff)
downloadpoky-96e2ee1d730fa19665cca34c2cc3deb3fa5dfd2d.tar.gz
Shift exception formatting into the UI
Now we use bb.exceptions to pass pickleable traceback entries to the UI, and the UI is free to do whatever it wants to do with this information. By default, the log formatter for the UIs formats it with bb.exceptions. This also means that all exceptions should now show 3 lines of context and limit to 5 entries. (Bitbake rev: ee48d628ee038bd72e1cd94aa75f5ccbacbcee4c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r--bitbake/lib/bb/event.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 4ff530fcb4..a3288b619b 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -30,6 +30,7 @@ except ImportError:
30 import pickle 30 import pickle
31import logging 31import logging
32import atexit 32import atexit
33import traceback
33import bb.utils 34import bb.utils
34 35
35# This is the pid for which we should generate the event. This is set when 36# This is the pid for which we should generate the event. This is set when
@@ -423,6 +424,12 @@ class LogHandler(logging.Handler):
423 """Dispatch logging messages as bitbake events""" 424 """Dispatch logging messages as bitbake events"""
424 425
425 def emit(self, record): 426 def emit(self, record):
427 if record.exc_info:
428 etype, value, tb = record.exc_info
429 if hasattr(tb, 'tb_next'):
430 tb = list(bb.exceptions.extract_traceback(tb, context=3))
431 record.bb_exc_info = (etype, value, tb)
432 record.exc_info = None
426 fire(record, None) 433 fire(record, None)
427 434
428 def filter(self, record): 435 def filter(self, record):