Back to Skills

python-logging

verified

Use when choosing or configuring Python logging, especially deciding between stdlib logging and loguru for apps or CLIs.

View on GitHub

Marketplace

narumi

narumiruna/claude-marketplace

Plugin

gourmet-research

Repository

narumiruna/claude-marketplace
2stars

skills/python-logging/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/narumiruna/claude-marketplace/blob/main/skills/python-logging/SKILL.md -a claude-code --skill python-logging

Installation paths:

Claude
.claude/skills/python-logging/
Powered by add-skill CLI

Instructions

# 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:
```python
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 patterns
- `references/loguru.md` - loguru patterns

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
1084 chars