Configuring python logging
Skill narumiruna/skills/skills/python/configuring-python-logging
npx -y skills add narumiruna/skills --skill configuring-python-loggingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Choose, configure, or review Python logging for libraries, services, apps, and CLIs, especially when deciding between stdlib logging and Loguru or defining handlers, levels, context, and exception behavior.
SKILL.md
2.1 KB, as published. Nobody here has run it
Python Logging
Choose the logging boundary before choosing syntax.
Decision
- Use stdlib
loggingfor reusable libraries, long-lived services, mixed ecosystems, and standard Sentry/OpenTelemetry or handler integration. - Consider Loguru for a small app or CLI that owns process startup and the full logging surface.
- In mixed systems, keep libraries on stdlib logging and let the application own any deliberate bridge.
Workflow
- Inspect the existing logging stack, entry points, deployment environment, and operational integrations.
- Keep libraries passive: create
logging.getLogger(__name__); do not configure process-wide handlers or levels during import. - Configure logging once at the app or CLI boundary. Prevent duplicate handlers or sinks when setup can run repeatedly.
- Set levels and formats for the actual audience. Add structured fields at a defined boundary and provide defaults when third-party records use the same formatter.
- Preserve exception semantics: log tracebacks without silently swallowing failures unless recovery is intentional and tested.
- Add file, network, telemetry, or other data-egress sinks only when requested or already established by project policy; external destinations require explicit authorization and secret-safe configuration.
- Exercise representative application, library, third-party, and exception records. Report the backend chosen, configuration boundary, checks run, and any integration caveat.
Focused References
- Read
references/logging.mdfor stdlib logger, handler, context, and exception patterns. - Read
references/loguru.mdonly when the application owns Loguru configuration.
Do not mix backends without an explicit ownership and interoperability plan, hide global setup in imported modules, or add sinks inside repeatedly called functions.