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 @@ -181,20 +181,19 @@ def at_exit(self):
181181 self .flush ()
182182 self .producer .close ()
183183
184- def unhandled_exception (self , _ , exception , __ ):
184+ def unhandled_exception (self , exctype , exception , traceback ):
185185 """
186186 Log top-level exception to the provided logger.
187187
188188 Args:
189+ exctype (type): type of the exception
189190 exception (Exception): exception object from excepthook
190-
191+ traceback (traceback): traceback object
191192 """
192193 if self .unhandled_exception_logger is not None :
193- try :
194- raise exception
195- except Exception :
196- self .unhandled_exception_logger .exception (
197- "Unhandled top-level exception" )
194+ self .unhandled_exception_logger .exception (
195+ "Unhandled top-level exception" ,
196+ exc_info = (exctype , exception , traceback , ))
198197
199198 def close (self ):
200199 """Close the handler."""
You can’t perform that action at this time.
0 commit comments