log-coverage-analyzer
Installation
SKILL.md
This skill performs comprehensive log coverage analysis for code repositories. It identifies logging deficiencies in call chains and detects high-frequency log risks that may impact performance.
Analysis Principles
Log Level Definitions
| Log Level | Behavior | Use Case |
|---|---|---|
| LOGE | Always prints, never lost | Critical - Must exist on all error return paths |
| LOGI | Always prints, may be lost if high-frequency triggered at same location | Important - Success paths, key operations |
| LOGD | Only prints when debug switch enabled | Optional - Debug information only |
| LOGW | Only prints when debug switch enabled | Optional - Warning information only |
Core Analysis Rules
- Log Coverage Rule: Each branch in a function call chain must have LOGE or LOGI level logging
- High-Frequency Risk Rule: Functions that may be called frequently (loops, timers, callbacks, event handlers) with LOGE/LOGI logs pose performance risks
- Error Path Rule: All error return paths MUST have LOGE logging
- Context Rule: All logs must include sufficient context information (IDs, states, parameters)