You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OPENROUTER_DEBUG reconfigures the root logger, forcing DEBUG output for the entire process #590
src/openrouter/utils/logger.py:25 calls logging.basicConfig(level=logging.DEBUG) when OPENROUTER_DEBUG is set. get_default_logger() runs at client construction
(src/openrouter/sdk.py:183), so simply instantiating OpenRouter() mutates the host
application's root logger.
Measured before/after OpenRouter(...) with OPENROUTER_DEBUG=1:
Every library in the process then emits DEBUG to stderr — httpx's request log showed up in
my capture — not just the SDK.
Why it's wrong
A library should configure its own logger, never the root one. basicConfig is for
applications; it's a global side effect that the caller didn't opt into and can't easily
undo. It also overrides any logging setup the app performed before the client was built.
No credential leakage here — httpx renders the auth header as 'authorization': '[secure]'
— so this is noise/ownership, not a security issue.
Note: utils/logger.py is Speakeasy-generated (DO NOT EDIT header), so the change needs
to land in the generator template / gen config rather than as a direct edit here.
Activity