2 Commits
Author SHA1 Message Date
dsql 0e0646a5d6 chore: bump to 1.1.0 (logging-discipline audit)
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-08-10 23:00:50 -04:00
dsql 270d7df9ae 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>
2026-08-09 02:14:11 -04:00
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "dpy_logger" name = "dpy_logger"
version = "1.0.0" version = "1.1.0"
description = "Leveled Discord channel logger for discord.py — config-free, injectable, installable." description = "Leveled Discord channel logger for discord.py — config-free, injectable, installable."
requires-python = ">=3.10" requires-python = ">=3.10"
dependencies = [ dependencies = [
+5 -2
View File
@@ -213,8 +213,11 @@ class DPYLogger:
content=content, content=content,
embed=self.build_embed(level, action, actor, log_msg), embed=self.build_embed(level, action, actor, log_msg),
) )
except Exception: except Exception as exc:
_log.exception(f"[dpy_logger] failed to send {level} log: {log_msg}") # 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 return None
async def debug(self, log, action=None, actor=None, guild=None, log_to_file=None): async def debug(self, log, action=None, actor=None, guild=None, log_to_file=None):