File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import warnings
1515
1616from basictracer .recorder import SpanRecorder
17- from opentracing .logs import ERROR_KIND , STACK
17+ from opentracing .logs import ERROR_KIND , STACK , ERROR_OBJECT
1818
1919from lightstep .http_converter import HttpConverter
2020from lightstep .thrift_converter import ThriftConverter
@@ -171,7 +171,11 @@ def _normalize_log(self, log):
171171 log .key_values [ERROR_KIND ] = util ._format_exc_type (log .key_values [ERROR_KIND ])
172172
173173 if STACK in log .key_values :
174- log .key_values [STACK ] = util ._format_exc_tb (log .key_values [STACK ])
174+ log .key_values [STACK ] = util ._format_exc_tb (
175+ log .key_values .get (ERROR_OBJECT ),
176+ log .key_values .get (ERROR_KIND ),
177+ log .key_values [STACK ]
178+ )
175179
176180 return log
177181
Original file line number Diff line number Diff line change @@ -105,9 +105,9 @@ def _coerce_to_unicode(val):
105105 return '(encoding error)'
106106
107107
108- def _format_exc_tb (exc_tb ):
108+ def _format_exc_tb (exc_value , exc_type , exc_tb ):
109109 if type (exc_tb ) is types .TracebackType :
110- return '' .join (traceback .format_tb ( exc_tb ))
110+ return '' .join (traceback .format_exception ( exc_value , exc_type , exc_tb ))
111111
112112 return exc_tb
113113
You can’t perform that action at this time.
0 commit comments