diff --git a/config.ini.sample b/config.ini.sample index 4626cb5..61937fd 100644 --- a/config.ini.sample +++ b/config.ini.sample @@ -9,6 +9,7 @@ threads = 10 timeout = 15 submit_after = 200 use_ssl = false +debug = false [proxyfind] search = true diff --git a/config.py b/config.py index ccb254d..3aa867f 100644 --- a/config.py +++ b/config.py @@ -20,6 +20,8 @@ def load(): timeout = parser.getint('watcherd', 'timeout') submit_after = parser.getint('watcherd', 'submit_after') use_ssl = parser.getboolean('watcherd', 'use_ssl') + global watchd_debug + watchd_debug = parser.getboolean('watcherd', 'debug') # allow overriding select items from the commandline import argparse diff --git a/proxywatchd.py b/proxywatchd.py index f2a6c35..cae1c9d 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -42,6 +42,9 @@ class WorkerJob(): sock.send('%s\n' % random.choice(['NICK', 'USER', 'JOIN', 'MODE', 'PART', 'INVITE', 'KNOCK', 'WHOIS', 'WHO', 'NOTICE', 'PRIVMSG', 'PING', 'QUIT'])) return sock, proto, duration, torhost, srv, 0 except rocksock.RocksockException as e: + if config.watchd_debug: + _log("proxy failed: %s://%s: %s"%(proto, self.proxy, e.get_errormessage()), 'debug') + et = e.get_errortype() err = e.get_error() fp = e.get_failedproxy()