diff options
Diffstat (limited to 'sshban.py')
-rwxr-xr-x | sshban.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -177,6 +177,11 @@ for h in handlers: h.setFormatter(formatter) logger.addHandler(h) +# log uncaught top-level exception +def excepthook(t, v, tb, logger = logger): + logger.error('Uncaught top-level exception', exc_info = (t, v, tb)) +sys.excepthook = excepthook + judge = Judge({ ACT_BAN_SHORT : args.thresh_short, ACT_BAN_MEDIUM : args.thresh_medium, ACT_BAN_LONG : args.thresh_long }) # open FIFO read-write so poll() won't return HUP endlessly if the writer dies |