From 3e9b05a8e8cb1d67e0d2a70700efb46314a22059 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Mon, 29 Jun 2026 03:18:13 -0400 Subject: [PATCH] fix: restore task() actor kwarg (accept-and-ignore) for caller compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the original task() accepted an actor kwarg and ignored it (task actions are always attributed to SYSTEM/TASK); the rewrite dropped the param, so live callers passing task(..., actor=...) hit a TypeError. added actor=None back, accept-and-ignore, behavior unchanged. bump to v0.1.1. (feed() stays out of the base by design — consumers subclass.) Signed-off-by: disqualifier --- README.md | 4 ++-- ledger.md | 21 +++++++++++++++++++++ pyproject.toml | 2 +- src/dpy_logger/dpy_logger.py | 8 ++++++-- 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 ledger.md diff --git a/README.md b/README.md index db9a014..510e0d6 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ live from `bot.settings` so it can change at runtime via a command. `requirements.txt`: ``` -dpy_logger @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_logger.git@v0.1.0 +dpy_logger @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_logger.git@v0.1.1 ``` Direct: ```bash -pip install "dpy_logger @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_logger.git@v0.1.0" +pip install "dpy_logger @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_logger.git@v0.1.1" ``` Requires `discord.py` (pulled transitively). diff --git a/ledger.md b/ledger.md new file mode 100644 index 0000000..935855a --- /dev/null +++ b/ledger.md @@ -0,0 +1,21 @@ +# dpy_logger — ledger + +## v0.1.1 + +- **fidelity fix (HIGH):** restored the `actor` kwarg on `task()` (accept-and-ignore). + The original accepted `actor` and ignored it (task actions are always attributed to + SYSTEM/TASK); the rewrite dropped the param, so live callers passing + `task(..., actor=...)` hit a `TypeError`. Param is back, behavior unchanged. +- guild-id comparison fix: `_get_channel` compares by `.id` so an uninitialized int + guild routes to the constructed channel instead of falling through to settings. +- docstring/README error-contract accuracy: resolution raises from `initialize()` (type + may be `ValueError` or an underlying discord exception); per-call resolution + send + failures are swallowed to the stdlib fallback. + +Note: `feed()` is intentionally NOT on the base class — consumers subclass to add it +(see README "Adding a log type"). + +## v0.1.0 + +- initial: leveled discord channel logger (debug/info/success/fail/task/critical), + dual-sink (channel + stdlib), embed_builder hook, dynamic per-guild routing. diff --git a/pyproject.toml b/pyproject.toml index 8fa502a..551cd1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "dpy_logger" -version = "0.1.0" +version = "0.1.1" description = "Leveled Discord channel logger for discord.py — config-free, injectable, installable." requires-python = ">=3.10" dependencies = [ diff --git a/src/dpy_logger/dpy_logger.py b/src/dpy_logger/dpy_logger.py index 40ba683..ccc6134 100644 --- a/src/dpy_logger/dpy_logger.py +++ b/src/dpy_logger/dpy_logger.py @@ -206,8 +206,12 @@ class DPYLogger: failure = fail - async def task(self, log, action=None, guild=None, log_to_file=None): - """log a task-level message with SYSTEM/TASK as the actor""" + async def task(self, log, action=None, actor=None, guild=None, log_to_file=None): + """log a task-level message with SYSTEM/TASK as the actor + + actor is accepted for caller compatibility and ignored — task actions are + always attributed to SYSTEM/TASK regardless of the caller-supplied actor + """ return await self._send("task", log, action, "SYSTEM/TASK", guild, log_to_file) async def critical(self, log, action=None, actor=None, guild=None, log_to_file=None):