File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -178,20 +178,19 @@ def at_exit(self):
178178 self .flush ()
179179 self .producer .close ()
180180
181- def unhandled_exception (self , _ , exception , __ ):
181+ def unhandled_exception (self , exctype , exception , traceback ):
182182 """
183183 Log top-level exception to the provided logger.
184184
185185 Args:
186+ exctype (type): type of the exception
186187 exception (Exception): exception object from excepthook
187-
188+ traceback (traceback): traceback object
188189 """
189190 if self .unhandled_exception_logger is not None :
190- try :
191- raise exception
192- except Exception :
193- self .unhandled_exception_logger .exception (
194- "Unhandled top-level exception" )
191+ self .unhandled_exception_logger .exception (
192+ "Unhandled top-level exception" ,
193+ exc_info = (exctype , exception , traceback , ))
195194
196195 def close (self ):
197196 """Close the handler."""
You can’t perform that action at this time.
0 commit comments