aboutsummaryrefslogtreecommitdiff
path: root/src/IRCBot.py
diff options
context:
space:
mode:
authorGravatar jesopo2020-07-03 10:31:23 +0100
committerGravatar jesopo2020-07-03 10:31:23 +0100
commit2d6efc4975d93b3d916a62ebb693ef079a3ba6f7 (patch)
tree70d5df7cc07e621c98154baea87ed46b2b93681a /src/IRCBot.py
parentstrip ':' and ',' from titles too (diff)
signature
log ip, if available, when connection fails (mostly for tls)
Diffstat (limited to 'src/IRCBot.py')
-rw-r--r--src/IRCBot.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py
index f5b66b23..b2c2861f 100644
--- a/src/IRCBot.py
+++ b/src/IRCBot.py
@@ -204,8 +204,12 @@ class Bot(object):
try:
server.connect()
except Exception as e:
- self.log.warn("Failed to connect to %s: %s",
- [str(server), str(e)])
+ ip = ""
+ if server.socket.connected_ip is not None:
+ ip = f" ({server.socket.connected_ip})"
+
+ self.log.warn("Failed to connect to %s%s: %s",
+ [str(server), ip, str(e)])
self.log.debug("Connection failure reason:", exc_info=True)
return False
self.servers[server.fileno()] = server