summaryrefslogtreecommitdiff
path: root/sshban.py
diff options
context:
space:
mode:
Diffstat (limited to 'sshban.py')
-rwxr-xr-xsshban.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sshban.py b/sshban.py
index 0479764..dd2a5f2 100755
--- a/sshban.py
+++ b/sshban.py
@@ -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