logging

Review logging code for Info/Debug levels and terminal error handling.

3|1|Updated Feb 3, 2012
One-click install
npx skills add https://github.com/shishi/dotfiles --skill logging-shishi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging
Source: https://github.com/shishi/dotfiles/tree/main/claude/skills/logging
Command: npx skills add https://github.com/shishi/dotfiles --skill logging-shishi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Logging is often either too verbose or too quiet, making it hard to diagnose issues. This Skill guides you to adopt Dave Cheney's minimalist logging philosophy so logs stay relevant, actionable, and easy to surface.

Core Features & Use Cases

  • Two main levels: Info for operators and Debug for developers, with a clear boundary between user-facing and developer-facing logs.
  • Log-level discipline: Remove unnecessary levels (Warning, Fatal) or use them appropriately in context.
  • Error handling discipline: Do not log and return; let errors bubble up to the caller; log at terminal boundaries when needed.
  • Structured logging: Prefer structured, contextual log entries with key-value fields.

Quick Start

Apply Dave Cheney's logging philosophy across the codebase by reducing log levels to Info/Debug, avoiding library-level error logs, and ensuring errors propagate to callers.

Frequently Asked Questions about logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to handle error logging and avoid bubbling errors in Go?

The best way to handle error logging is to avoid logging and returning errors simultaneously. You should let errors bubble up to the caller and only log them at terminal boundaries, preventing duplicate logs and ensuring clean error propagation.

How do I choose between Info and Debug log levels for structured logging?

To choose between Info and Debug log levels, use Info for operator-facing messages and Debug for developer-facing diagnostics. This structured logging discipline creates a clear boundary, keeping logs relevant and actionable for each audience.

Why should I remove Warning and Fatal levels when designing application logs?

You should remove Warning and Fatal levels to enforce log-level discipline and reduce noise. Consolidating to Info and Debug levels creates minimalist logging, making logs more meaningful and preventing unnecessary fatal-level crashes in library code.

Can I use structured logging for code review to improve observability?

Yes, you can use structured logging during code review to improve observability. Reviewing logging code involves checking for contextual key-value fields, ensuring proper Info versus Debug boundaries, and verifying that library-level error logs are removed.

When do I need terminal error handling instead of logging directly in libraries?

You need terminal error handling instead of logging directly in libraries when an error reaches the end of its execution path. Libraries should return errors to the caller, while terminal handling logs the error only at the application's top level.