def excepthook(exctype, value, traceback):
 getLogger('fail2ban').critical('Unhandled exception in Fail2Ban:', exc_info=True)
 return sys.__excepthook__(exctype, value, traceback)

def excepthook ( exctype , value , traceback ) : getLogger ( 'fail2ban' ) . critical ( 'Unhandled exception in Fail2Ban:' , exc_info = True ) return sys . __excepthook__ ( exctype , value , traceback )
except hook used to log unhandled exceptions to fail2ban log .