diff options
| author | Hornwitser <[email protected]> | 2018-07-31 18:19:43 +0200 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-11-24 22:17:58 -0500 |
| commit | 34fd266cf9e743d72603c9a73f3fff29fcb9d6e8 (patch) | |
| tree | 50501988576635df4203b9f7bb951ac07073f20e /discord/gateway.py | |
| parent | [lint]Â Simplyfy util.valid_icon_size (diff) | |
| download | discord.py-34fd266cf9e743d72603c9a73f3fff29fcb9d6e8.tar.xz discord.py-34fd266cf9e743d72603c9a73f3fff29fcb9d6e8.zip | |
[lint] Do log formating lazily
Convert log("fmt" % args) to log("fmt", args) as the latter is lazy and
does not do the formating if the string is never logged.
Diffstat (limited to 'discord/gateway.py')
| -rw-r--r-- | discord/gateway.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/gateway.py b/discord/gateway.py index 7e297d4f..a8c8ee24 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -70,7 +70,7 @@ class KeepAliveHandler(threading.Thread): def run(self): while not self._stop_ev.wait(self.interval): if self._last_ack + self.heartbeat_timeout < time.perf_counter(): - log.warning("Shard ID %s has stopped responding to the gateway. Closing and restarting." % self.shard_id) + log.warning("Shard ID %s has stopped responding to the gateway. Closing and restarting.", self.shard_id) coro = self.ws.close(4000) f = asyncio.run_coroutine_threadsafe(coro, loop=self.ws.loop) @@ -370,7 +370,7 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol): self.sequence = None self.session_id = None - log.info('Shard ID %s session has been invalidated.' % self.shard_id) + log.info('Shard ID %s session has been invalidated.', self.shard_id) await self.identify() return |