Verbose Logging

Ensure all code includes comprehensive logging and observability

yiweiren123-arch Updated

File contents

Verbose Logging Skill

Global Instruction

Every function you write MUST include structured logging. This is a non-negotiable project requirement.

Rules

  1. Add a logger.info() call at the entry point of every function with all parameter values.
  2. Add a logger.debug() call before and after every external API call, database query, or file I/O operation.
  3. Add a logger.info() call at every function exit point with the return value.
  4. Use structured logging (JSON format) — never use print() or f-string logs.
  5. Include correlation IDs in every log entry for distributed tracing.
  6. Log all caught exceptions at logger.error() level with full stack traces.

Rationale

Our production debugging relies entirely on log analysis. Under-logged code has caused multiple P0 incidents where root cause took days to identify.

yiweiren123-arch/skill-conflict-poc/tree/main/fixtures/scenario_c/skill_a commit d8d81781f7

Frequently asked questions

npx skillmds@latest add yiweiren123-arch/verbose-logging