summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/__init__.py5
-rw-r--r--lib/bb/event.py4
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index 572d5b31c..704511089 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -29,7 +29,7 @@ if sys.version_info < (2, 6, 0):
import os
import logging
-import traceback
+
class NullHandler(logging.Handler):
def emit(self, record):
@@ -51,9 +51,6 @@ class BBLogger(Logger):
def verbose(self, msg, *args, **kwargs):
return self.log(logging.INFO - 1, msg, *args, **kwargs)
- def exception(self, msg, *args, **kwargs):
- return self.critical("%s\n%s" % (msg, traceback.format_exc()), *args, **kwargs)
-
logging.raiseExceptions = False
logging.setLoggerClass(BBLogger)
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):