drivers: Log SOCKS proxy on connecting

This commit is contained in:
Valentin Lorentz 2021-05-26 23:43:23 +02:00
parent c3f39fc93b
commit cca1156b90
2 changed files with 9 additions and 4 deletions

View File

@ -278,7 +278,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
drivers.log.connectError(self.currentServer, e)
self.scheduleReconnect()
return
drivers.log.connect(self.currentServer)
drivers.log.connect(self.currentServer, socks_proxy=socks_proxy)
try:
self.conn = utils.net.getSocket(
address,

View File

@ -173,9 +173,14 @@ def run():
class Log(object):
"""This is used to have a nice, consistent interface for drivers to use."""
def connect(self, server):
self.info('Connecting to %s:%s.',
server.hostname, server.port)
def connect(self, server, socks_proxy=None):
if socks_proxy:
socks_phrase = ' Via SOCKS proxy %s'
else:
socks_phrase = ''
socks_proxy = ''
self.info('Connecting to %s:%s.' + socks_phrase,
server.hostname, server.port, socks_proxy)
def connectError(self, server, e):
if isinstance(e, Exception):