From praxis
Logging conventions — level usage, formatting style, structured output.
How this skill is triggered — by the user, by Claude, or both
Slash command
/praxis:logging-patternsWhen to use
Writing code that logs events, configuring log output, or choosing log levels.
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
One logger per module, at module level:
One logger per module, at module level:
import logging
logger = logging.getLogger(__name__)
Use %s-style formatting arguments, not f-strings — the message template is preserved for structured aggregator queries:
logger.info("Cleaned up %d expired sessions", count) # yes
logger.error("SMTP send failed for %s", email, exc_info=True) # yes
logger.info(f"Cleaned up {count} expired sessions") # no
| Level | Use for |
|---|---|
DEBUG | Cache hit/miss, slow-path internals (opt-in only) |
INFO | Startup/shutdown, admin bootstrap, cleanup counts, rate limit hits |
WARNING | Recoverable anomalies, swallowed exceptions, degraded operation |
ERROR | Unexpected exceptions on operational paths — always with exc_info=True |
CRITICAL | Reserved for unusable state |
One record per line on stdout. Let the container runtime (Docker, k8s) capture it — no file sinks or log rotation in-app.
Support two formats via config:
plain — Readable for local devjson — Stable single-line object per record for log aggregators (Loki, Datadog, ELK, CloudWatch)Timestamps in UTC in both formats.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub jartan-llc/grimoire --plugin praxis