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) drivers.log.connectError(self.currentServer, e)
self.scheduleReconnect() self.scheduleReconnect()
return return
drivers.log.connect(self.currentServer) drivers.log.connect(self.currentServer, socks_proxy=socks_proxy)
try: try:
self.conn = utils.net.getSocket( self.conn = utils.net.getSocket(
address, address,

View File

@ -173,9 +173,14 @@ def run():
class Log(object): class Log(object):
"""This is used to have a nice, consistent interface for drivers to use.""" """This is used to have a nice, consistent interface for drivers to use."""
def connect(self, server): def connect(self, server, socks_proxy=None):
self.info('Connecting to %s:%s.', if socks_proxy:
server.hostname, server.port) 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): def connectError(self, server, e):
if isinstance(e, Exception): if isinstance(e, Exception):