fix: discord send failure logs WARNING, not ERROR (D4)
_send mirrors the record to the stdlib sink BEFORE attempting the discord send, so a swallowed send failure is recovered cleanly - the log survives, only the channel mirror was lost. that is a WARNING (recovered), not an ERROR. demote from _log.exception (ERROR + traceback) to _log.warning with the reason folded in lazily; the traceback belonged on a terminal/unhandled path, and this one recovers via the guaranteed stdlib record. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -213,8 +213,11 @@ class DPYLogger:
|
||||
content=content,
|
||||
embed=self.build_embed(level, action, actor, log_msg),
|
||||
)
|
||||
except Exception:
|
||||
_log.exception(f"[dpy_logger] failed to send {level} log: {log_msg}")
|
||||
except Exception as exc:
|
||||
# WARNING, not ERROR: the record was already mirrored to the stdlib sink BEFORE the
|
||||
# send (see _emit_stdlib above), so a swallowed discord-send failure is recovered
|
||||
# cleanly - the log survives, only the channel mirror was lost. lazy interpolation.
|
||||
_log.warning("[dpy_logger] failed to send %s log: %s (%s)", level, log_msg, exc)
|
||||
return None
|
||||
|
||||
async def debug(self, log, action=None, actor=None, guild=None, log_to_file=None):
|
||||
|
||||
Reference in New Issue
Block a user