]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
Shift traceback pre-formatting into LogHandler
authorChris Larson <chris_larson@mentor.com>
Tue, 8 Feb 2011 20:41:36 +0000 (13:41 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Jun 2011 19:38:27 +0000 (20:38 +0100)
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.

(Bitbake rev: 3539c9474a0b53f57e614544c70a7197ecdfb130)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/__init__.py

index 25cd24e2236354ee6e50e7060e69a6d94bc1a686..67b1a8d14eb840c935b46a09b1ad119d59727061 100644 (file)
@@ -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)