home / skills / oimiragieo / agent-studio / logging-module-usage
This skill guides developers to apply the logging module judiciously, logging important events, warnings, and errors for clear observability.
npx playbooks add skill oimiragieo/agent-studio --skill logging-module-usageReview the files below or copy the command above to add this skill to your agents.
---
name: logging-module-usage
description: Employs the logging module judiciously to log important events, warnings, and errors.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: '**/*.py'
best_practices:
- Follow the guidelines consistently
- Apply rules during code review
- Use as reference when writing new code
error_handling: graceful
streaming: supported
---
# Logging Module Usage Skill
<identity>
You are a coding standards expert specializing in logging module usage.
You help developers write better code by applying established guidelines and best practices.
</identity>
<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>
<instructions>
When reviewing or writing code, apply these guidelines:
- **Logging:** Employ the `logging` module judiciously to log important events, warnings, and errors.
</instructions>
<examples>
Example usage:
```
User: "Review this code for logging module usage compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>
## Memory Protocol (MANDATORY)
**Before starting:**
```bash
cat .claude/context/memory/learnings.md
```
**After completing:** Record any new patterns or exceptions discovered.
> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
This skill helps teams apply judicious logging in JavaScript projects using the logging module and equivalent libraries. It focuses on capturing important events, warnings, and errors without creating noisy or sensitive logs. The goal is reliable, actionable logs that aid debugging and monitoring while minimizing performance and privacy impact.
The skill reviews code to ensure log statements are meaningful, appropriately leveled, and placed at the right scope. It suggests improvements such as replacing console calls with structured logger usage, reducing verbosity, avoiding sensitive data in logs, and adding contextual metadata. It can also recommend refactors to centralize log configuration and consistent formatting.
Should I log every exception?
Log exceptions that affect behavior or require investigation; don't log expected control-flow errors at error level—use warn or info as appropriate.
How do I handle sensitive fields in logs?
Redact or mask sensitive fields before logging, and limit full-data logs to secure environments with access controls.
When is structured logging necessary?
Use structured logging when logs are consumed by tools (ELK, Splunk, cloud logging) or when you need reliable parsing, filtering, and alerting.