diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-02-08 13:41:36 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 20:38:27 +0100 |
commit | 95f02a2ab1240b3de04bd725ca43e08b6e15caef (patch) | |
tree | 993f9e2d812f32eed01cbf27eccbcdd27053f401 /bitbake | |
parent | 355338c40c6fc65d10980cfd75e9ab5ff96ed43a (diff) | |
download | poky-95f02a2ab1240b3de04bd725ca43e08b6e15caef.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.
(Bitbake rev: 3539c9474a0b53f57e614544c70a7197ecdfb130)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/__init__.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index 25cd24e223..67b1a8d14e 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
@@ -29,7 +29,7 @@ if sys.version_info < (2, 6, 0): | |||
29 | 29 | ||
30 | import os | 30 | import os |
31 | import logging | 31 | import logging |
32 | import traceback | 32 | |
33 | 33 | ||
34 | class NullHandler(logging.Handler): | 34 | class NullHandler(logging.Handler): |
35 | def emit(self, record): | 35 | def emit(self, record): |
@@ -51,9 +51,6 @@ class BBLogger(Logger): | |||
51 | def verbose(self, msg, *args, **kwargs): | 51 | def verbose(self, msg, *args, **kwargs): |
52 | return self.log(logging.INFO - 1, msg, *args, **kwargs) | 52 | return self.log(logging.INFO - 1, msg, *args, **kwargs) |
53 | 53 | ||
54 | def exception(self, msg, *args, **kwargs): | ||
55 | return self.critical("%s\n%s" % (msg, traceback.format_exc()), *args, **kwargs) | ||
56 | |||
57 | logging.raiseExceptions = False | 54 | logging.raiseExceptions = False |
58 | logging.setLoggerClass(BBLogger) | 55 | logging.setLoggerClass(BBLogger) |
59 | 56 | ||