mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-13 13:25:26 +00:00
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:
parent
0ec06f0ac5
commit
3802780f77
@ -683,7 +683,7 @@ class Client:
|
|||||||
while True:
|
while True:
|
||||||
await self.ws.poll_event()
|
await self.ws.poll_event()
|
||||||
except ReconnectWebSocket as e:
|
except ReconnectWebSocket as e:
|
||||||
_log.info('Got a request to %s the websocket.', e.op)
|
_log.debug('Got a request to %s the websocket.', e.op)
|
||||||
self.dispatch('disconnect')
|
self.dispatch('disconnect')
|
||||||
ws_params.update(sequence=self.ws.sequence, resume=e.resume, session=self.ws.session_id)
|
ws_params.update(sequence=self.ws.sequence, resume=e.resume, session=self.ws.session_id)
|
||||||
if e.resume:
|
if e.resume:
|
||||||
|
@ -467,7 +467,7 @@ class DiscordWebSocket:
|
|||||||
|
|
||||||
await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
|
await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
|
||||||
await self.send_as_json(payload)
|
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:
|
async def resume(self) -> None:
|
||||||
"""Sends the RESUME packet."""
|
"""Sends the RESUME packet."""
|
||||||
@ -481,7 +481,7 @@ class DiscordWebSocket:
|
|||||||
}
|
}
|
||||||
|
|
||||||
await self.send_as_json(payload)
|
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:
|
async def received_message(self, msg: Any, /) -> None:
|
||||||
if type(msg) is bytes:
|
if type(msg) is bytes:
|
||||||
@ -633,15 +633,15 @@ class DiscordWebSocket:
|
|||||||
self._keep_alive = None
|
self._keep_alive = None
|
||||||
|
|
||||||
if isinstance(e, asyncio.TimeoutError):
|
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
|
raise ReconnectWebSocket(self.shard_id) from None
|
||||||
|
|
||||||
code = self._close_code or self.socket.close_code
|
code = self._close_code or self.socket.close_code
|
||||||
if self._can_handle_close():
|
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
|
raise ReconnectWebSocket(self.shard_id) from None
|
||||||
else:
|
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
|
raise ConnectionClosed(self.socket, shard_id=self.shard_id, code=code) from None
|
||||||
|
|
||||||
async def debug_send(self, data: str, /) -> None:
|
async def debug_send(self, data: str, /) -> None:
|
||||||
@ -930,7 +930,7 @@ class DiscordVoiceWebSocket:
|
|||||||
if self._keep_alive:
|
if self._keep_alive:
|
||||||
self._keep_alive.ack()
|
self._keep_alive.ack()
|
||||||
elif op == self.RESUMED:
|
elif op == self.RESUMED:
|
||||||
_log.info('Voice RESUME succeeded.')
|
_log.debug('Voice RESUME succeeded.')
|
||||||
elif op == self.SESSION_DESCRIPTION:
|
elif op == self.SESSION_DESCRIPTION:
|
||||||
self._connection.mode = data['mode']
|
self._connection.mode = data['mode']
|
||||||
await self.load_secret_key(data)
|
await self.load_secret_key(data)
|
||||||
@ -969,7 +969,7 @@ class DiscordVoiceWebSocket:
|
|||||||
|
|
||||||
mode = modes[0]
|
mode = modes[0]
|
||||||
await self.select_protocol(state.ip, state.port, mode)
|
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
|
@property
|
||||||
def latency(self) -> float:
|
def latency(self) -> float:
|
||||||
@ -987,7 +987,7 @@ class DiscordVoiceWebSocket:
|
|||||||
return sum(heartbeat.recent_ack_latencies) / len(heartbeat.recent_ack_latencies)
|
return sum(heartbeat.recent_ack_latencies) / len(heartbeat.recent_ack_latencies)
|
||||||
|
|
||||||
async def load_secret_key(self, data: Dict[str, Any]) -> None:
|
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']
|
self.secret_key = self._connection.secret_key = data['secret_key']
|
||||||
await self.speak()
|
await self.speak()
|
||||||
await self.speak(SpeakingState.none)
|
await self.speak(SpeakingState.none)
|
||||||
|
@ -122,7 +122,7 @@ signal_ctl: SignalCtl = {
|
|||||||
|
|
||||||
def _err_lt(result: int, func: Callable, args: List) -> int:
|
def _err_lt(result: int, func: Callable, args: List) -> int:
|
||||||
if result < OK:
|
if result < OK:
|
||||||
_log.info('error has happened in %s', func.__name__)
|
_log.debug('error has happened in %s', func.__name__)
|
||||||
raise OpusError(result)
|
raise OpusError(result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ def _err_lt(result: int, func: Callable, args: List) -> int:
|
|||||||
def _err_ne(result: T, func: Callable, args: List) -> T:
|
def _err_ne(result: T, func: Callable, args: List) -> T:
|
||||||
ret = args[-1]._obj
|
ret = args[-1]._obj
|
||||||
if ret.value != OK:
|
if ret.value != OK:
|
||||||
_log.info('error has happened in %s', func.__name__)
|
_log.debug('error has happened in %s', func.__name__)
|
||||||
raise OpusError(ret.value)
|
raise OpusError(ret.value)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ class OpusError(DiscordException):
|
|||||||
def __init__(self, code: int):
|
def __init__(self, code: int):
|
||||||
self.code: int = code
|
self.code: int = code
|
||||||
msg = _lib.opus_strerror(self.code).decode('utf-8')
|
msg = _lib.opus_strerror(self.code).decode('utf-8')
|
||||||
_log.info('"%s" has happened', msg)
|
_log.debug('"%s" has happened', msg)
|
||||||
super().__init__(msg)
|
super().__init__(msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class FFmpegAudio(AudioSource):
|
|||||||
if proc is MISSING:
|
if proc is MISSING:
|
||||||
return
|
return
|
||||||
|
|
||||||
_log.info('Preparing to terminate ffmpeg process %s.', proc.pid)
|
_log.debug('Preparing to terminate ffmpeg process %s.', proc.pid)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
proc.kill()
|
proc.kill()
|
||||||
@ -533,9 +533,9 @@ class FFmpegOpusAudio(FFmpegAudio):
|
|||||||
except Exception:
|
except Exception:
|
||||||
_log.exception("Fallback probe using '%s' failed", executable)
|
_log.exception("Fallback probe using '%s' failed", executable)
|
||||||
else:
|
else:
|
||||||
_log.info("Fallback probe found codec=%s, bitrate=%s", codec, bitrate)
|
_log.debug("Fallback probe found codec=%s, bitrate=%s", codec, bitrate)
|
||||||
else:
|
else:
|
||||||
_log.info("Probe found codec=%s, bitrate=%s", codec, bitrate)
|
_log.debug("Probe found codec=%s, bitrate=%s", codec, bitrate)
|
||||||
finally:
|
finally:
|
||||||
return codec, bitrate
|
return codec, bitrate
|
||||||
|
|
||||||
@ -745,5 +745,5 @@ class AudioPlayer(threading.Thread):
|
|||||||
def _speak(self, speaking: SpeakingState) -> None:
|
def _speak(self, speaking: SpeakingState) -> None:
|
||||||
try:
|
try:
|
||||||
asyncio.run_coroutine_threadsafe(self.client.ws.speak(speaking), self.client.client.loop)
|
asyncio.run_coroutine_threadsafe(self.client.ws.speak(speaking), self.client.client.loop)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
_log.info("Speaking call in player failed: %s", e)
|
_log.exception("Speaking call in player failed")
|
||||||
|
@ -178,7 +178,7 @@ class Shard:
|
|||||||
self._cancel_task()
|
self._cancel_task()
|
||||||
self._dispatch('disconnect')
|
self._dispatch('disconnect')
|
||||||
self._dispatch('shard_disconnect', self.id)
|
self._dispatch('shard_disconnect', self.id)
|
||||||
_log.info('Got a request to %s the websocket at Shard ID %s.', exc.op, self.id)
|
_log.debug('Got a request to %s the websocket at Shard ID %s.', exc.op, self.id)
|
||||||
try:
|
try:
|
||||||
coro = DiscordWebSocket.from_client(
|
coro = DiscordWebSocket.from_client(
|
||||||
self._client,
|
self._client,
|
||||||
|
@ -1184,7 +1184,7 @@ class ConnectionState:
|
|||||||
try:
|
try:
|
||||||
await asyncio.wait_for(self.chunk_guild(guild), timeout=timeout)
|
await asyncio.wait_for(self.chunk_guild(guild), timeout=timeout)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
_log.info('Somehow timed out waiting for chunks.')
|
_log.warning('Somehow timed out waiting for chunks for guild ID %s.', guild.id)
|
||||||
|
|
||||||
if unavailable is False:
|
if unavailable is False:
|
||||||
self.dispatch('guild_available', guild)
|
self.dispatch('guild_available', guild)
|
||||||
|
@ -307,7 +307,7 @@ class VoiceClient(VoiceProtocol):
|
|||||||
|
|
||||||
async def on_voice_server_update(self, data: VoiceServerUpdatePayload) -> None:
|
async def on_voice_server_update(self, data: VoiceServerUpdatePayload) -> None:
|
||||||
if self._voice_server_complete.is_set():
|
if self._voice_server_complete.is_set():
|
||||||
_log.info('Ignoring extraneous voice server update.')
|
_log.warning('Ignoring extraneous voice server update.')
|
||||||
return
|
return
|
||||||
|
|
||||||
self.token = data['token']
|
self.token = data['token']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user