python-logginglisted
Install: claude install-skill wntic/pyhouse
# Python Logging
A log line exists to be **queried** — filtered, grouped, counted, alerted on. Prose cannot be queried, so
every occurrence worth recording produces **exactly one structured event**: a name plus fields, never a
sentence with values spliced into it. These rules hold whatever the architecture is.
Only one thing here varies from project to project, and it varies as a *consequence*, not as a separate
rule: an error is logged once, by the scope that can add context and will not re-raise it — and where a
project's errors propagate to decides which scope that is. Everything else is unconditional.
## When to use vs. neighbours
- Writing or changing any log call, naming an event, configuring logging → this skill.
- Annotation forms, record types, comments → `python-style`.
- The exception classes, what goes into their `context`, translation with `from exc`, best-effort
compensation itself → `exception-catalog`.
- Which layer of a hexagonal service may log at all → `hex-architecture`, in the `pyhouse-hex` plugin;
in a flat service, where the scope that stops a run's failure sits → `flat-layered` and
`flat-entrypoint`, in `pyhouse-flat`.
- Whether a test may assert on what was logged → `test-principles`.
- An event name as a frozen external contract among the others → `naming`.
## The event
Four obligations, whichever library provides them:
- **One logger, obtained at module level.** Not per call, not per instance, and not a second logging
mechanism runnin