Skip to content

Use awarning instead of deprecated awarn - #126

Merged
tobyclemson merged 1 commit into
mainfrom
use-awarning-instead-of-awarn
Sep 24, 2026
Merged

tobyclemson merged 1 commit into
mainfrom
use-awarning-instead-of-awarn

Conversation

@wickedwukong

@wickedwukong wickedwukong commented Sep 24, 2026 •

Copy link
Copy Markdown

structlog's awarn is a deprecated alias for awarning and is absent from structlog.stdlib.BoundLogger, the wrapper class used when integrating structlog with the standard library's logging module.

The logger at these call sites is resolved at bind time from the host application's global structlog configuration, so the library can't rely on FilteringBoundLogger-only members being present.

In store.py the call sits inside an except UnmetWriteConditionError handler, so the missing attribute raises AttributeError while that exception is being handled and replaces it — callers' except UnmetWriteConditionError handlers silently stop matching. Found via a redelivery path in a downstream service, where a duplicate guard stopped catching and wedged the subscriber.

awarning is present on every wrapper class and is otherwise identical: same level, same output.

structlog's awarn is a deprecated alias for awarning and is absent from
structlog.stdlib.BoundLogger, the wrapper class used when integrating
structlog with the standard library's logging module.

The logger these call sites use is resolved at bind time from the host
application's global structlog configuration, so the library cannot rely
on FilteringBoundLogger-only members being present.

In store.py the call sits inside an except UnmetWriteConditionError
handler, so a missing attribute raises AttributeError while that
exception is being handled and replaces it, causing callers' except
UnmetWriteConditionError handlers to silently stop matching.

awarning is present on every wrapper class and is otherwise identical.
@tobyclemson
tobyclemson merged commit a3be467 into main Sep 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants