Agent skill
python-logging
Use when choosing or configuring Python logging, especially deciding between stdlib logging and loguru for apps or CLIs.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/python-logging
SKILL.md
Python Logging
Overview
Choose the logging system based on project needs. Core principle: stdlib logging for libraries and ecosystem integration, loguru for fast, simple app/CLI logging.
Quick Reference
| Need | Use |
|---|---|
| Library or long-lived service | stdlib logging |
| Simple app or CLI | loguru |
| Integrations (Sentry/OTel) | stdlib logging |
Decision Rules
Use stdlib logging when:
- Building a reusable library
- You need handler hierarchies or integration with ops tooling
Use loguru when:
- You want minimal setup and readable output
- You are building a small app or CLI
Example
Stdlib logger setup:
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger.info("App started")
Common Mistakes
- Forcing loguru in a reusable library.
- Mixing two logging systems without a clear boundary.
Red Flags
- Logging recommendations with no rationale for library vs app use.
References
references/logging.md- stdlib logging patternsreferences/loguru.md- loguru patterns
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?