convention-logging

Enforce Python logging conventions for level selection, formatting, and masking.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sunLeee/optimization --skill convention-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convention-logging
Source: https://github.com/sunLeee/optimization/tree/main/.claude/skills/quality/style/logging
Command: npx skills add https://github.com/sunLeee/optimization --skill convention-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishing and enforcing consistent Python logging conventions across projects to improve debuggability, traceability, and security.

Core Features & Use Cases

  • Provides guidelines for choosing between standard logging and structlog.
  • Defines log levels, message formatting, and structured logging patterns for common scenarios.
  • Supplies examples and gotchas to avoid sensitive data leakage and noisy logs in production.
  • Use Case: Onboarding a new project, audit logging, and refactoring to align with team standards.

Quick Start

Configure a small Python module to follow the conventions and verify logs conform to the rules.

Frequently Asked Questions about convention-logging

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

FAQPage Schema
How do I standardize Python logging conventions across my projects?

To standardize Python logging, enforce consistent rules for level selection, message formatting, and structured patterns. This ensures safe, clear log output that improves debuggability and traceability across development and production environments.

What is the best way to choose between structlog and standard logging in Python?

Choosing between structlog and standard logging depends on your project's context. Guidelines provide decision criteria for development and production, ensuring you select the appropriate library to achieve structured and consistent logs.

How do I prevent sensitive data leakage in Python production logs?

Preventing sensitive data leakage requires applying masking conventions to your Python logs. Guidelines supply examples and gotchas to avoid exposing sensitive information and to reduce noisy logs in production environments.

Does this logging convention guidance work for existing Python codebases?

Yes, the logging convention guidance is applicable to both new and existing Python projects. It supports refactoring existing code to align with team standards during code reviews and production audits.

How do I verify that my Python logs conform to structured logging rules?

You can verify log conformance by configuring a Python module to follow the conventions and checking logs against the rules. This guidance is compatible with check-logging verification processes.