← ClaudeAtlas

python-logginglisted

Use when writing code that reports what it did or what went wrong — a log call, a `print` for progress or errors, an `except` that records a failure, or logging setup in an entry point, a CLI or a library. Owns one structured event per occurrence with a stable `<subject>_<past_tense_verb>` name and identifiers as fields, the rule that an error is logged once by the scope that stops it and never by a scope that re-raises, the warning a failed undo under compensation earns, logging configured once at the entry point and never inside a distributed package, what never reaches a log line, and a program's result on stdout as output rather than a log event, and a program whose stdout is its result logging to stderr. Annotation forms and comments are `python-style`; the error classes and their `context` are `exception-catalog`.
wntic/pyhouse · ★ 3 · Code & Development · score 76
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