Change a lot of logging INFO calls to be less verbose

Some of the logs were only useful for debug scenarios, so they have
been downgraded to DEBUG. Others were in INFO but supposed to be in
WARNING so those were upgraded.
This commit is contained in:
Rapptz
2022-08-15 10:21:36 -04:00
parent 0ec06f0ac5
commit 3802780f77
7 changed files with 20 additions and 20 deletions

View File

@ -467,7 +467,7 @@ class DiscordWebSocket:
await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
await self.send_as_json(payload)
_log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
_log.debug('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
async def resume(self) -> None:
"""Sends the RESUME packet."""
@ -481,7 +481,7 @@ class DiscordWebSocket:
}
await self.send_as_json(payload)
_log.info('Shard ID %s has sent the RESUME payload.', self.shard_id)
_log.debug('Shard ID %s has sent the RESUME payload.', self.shard_id)
async def received_message(self, msg: Any, /) -> None:
if type(msg) is bytes:
@ -633,15 +633,15 @@ class DiscordWebSocket:
self._keep_alive = None
if isinstance(e, asyncio.TimeoutError):
_log.info('Timed out receiving packet. Attempting a reconnect.')
_log.debug('Timed out receiving packet. Attempting a reconnect.')
raise ReconnectWebSocket(self.shard_id) from None
code = self._close_code or self.socket.close_code
if self._can_handle_close():
_log.info('Websocket closed with %s, attempting a reconnect.', code)
_log.debug('Websocket closed with %s, attempting a reconnect.', code)
raise ReconnectWebSocket(self.shard_id) from None
else:
_log.info('Websocket closed with %s, cannot reconnect.', code)
_log.debug('Websocket closed with %s, cannot reconnect.', code)
raise ConnectionClosed(self.socket, shard_id=self.shard_id, code=code) from None
async def debug_send(self, data: str, /) -> None:
@ -930,7 +930,7 @@ class DiscordVoiceWebSocket:
if self._keep_alive:
self._keep_alive.ack()
elif op == self.RESUMED:
_log.info('Voice RESUME succeeded.')
_log.debug('Voice RESUME succeeded.')
elif op == self.SESSION_DESCRIPTION:
self._connection.mode = data['mode']
await self.load_secret_key(data)
@ -969,7 +969,7 @@ class DiscordVoiceWebSocket:
mode = modes[0]
await self.select_protocol(state.ip, state.port, mode)
_log.info('selected the voice protocol for use (%s)', mode)
_log.debug('selected the voice protocol for use (%s)', mode)
@property
def latency(self) -> float:
@ -987,7 +987,7 @@ class DiscordVoiceWebSocket:
return sum(heartbeat.recent_ack_latencies) / len(heartbeat.recent_ack_latencies)
async def load_secret_key(self, data: Dict[str, Any]) -> None:
_log.info('received secret key for voice connection')
_log.debug('received secret key for voice connection')
self.secret_key = self._connection.secret_key = data['secret_key']
await self.speak()
await self.speak(SpeakingState.none)