Improve logging in more places.

This shows the Shard ID in more places, along with a gateway trace and
session ID. Also helps show the RESUME/IDENTIFY/RESUMED/READY flow a
bit more instead of it looking like the connection has zombied out.
This commit is contained in:
Rapptz
2017-04-12 19:37:54 -04:00
parent 3e15f46dcf
commit ac90159c72
3 changed files with 21 additions and 14 deletions

View File

@ -55,7 +55,7 @@ class Shard:
try:
yield from self.ws.poll_event()
except ResumeWebSocket as e:
log.info('Got a request to RESUME the websocket.')
log.info('Got a request to RESUME the websocket at Shard ID %s.', self.id)
self.ws = yield from DiscordWebSocket.from_client(self._client, resume=True,
shard_id=self.id,
session=self.ws.session_id,
@ -191,7 +191,6 @@ class AutoShardedClient(Client):
# OP HELLO
yield from ws.poll_event()
yield from ws.identify()
log.info('Sent IDENTIFY payload to create the websocket for shard_id: %s' % shard_id)
# keep reading the shard while others connect
self.shards[shard_id] = ret = Shard(ws, self)