Claude-skill-registry debug-log-patterns
Language-specific debug logging patterns and best practices. Reference when adding instrumentation for Dart/Flutter, Kotlin/Android, Swift/iOS, or JavaScript/TypeScript applications.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/debug-log-patterns" ~/.claude/skills/majiayu000-claude-skill-registry-debug-log-patterns && rm -rf "$T"
manifest:
skills/data/debug-log-patterns/SKILL.mdsource content
Debug Log Patterns
Overview
This skill provides copy-paste-ready logging patterns for common debugging scenarios across multiple languages. Use these patterns when instrumenting code during PDCA debug cycles.
Supported Languages
| Language | File | Primary Use Case |
|---|---|---|
| Dart/Flutter | | Flutter mobile/web apps |
| Kotlin/Android | | Native Android apps |
| Swift/iOS | | Native iOS apps |
| JavaScript/TypeScript | | Web apps, Node.js, React Native |
Universal Conventions
Log Format Standard
All logs should follow this format for consistency:
[ClassName] methodName: description key=value
Log Levels
| Level | When to Use |
|---|---|
| DEBUG/TRACE | Detailed flow tracing, variable values |
| INFO | Significant events, state transitions |
| WARN | Unexpected but recoverable situations |
| ERROR | Failures that affect functionality |
Common Patterns (All Languages)
Pattern: Method Entry/Exit
[ClassName] methodName: ENTER params=(param1, param2) [ClassName] methodName: EXIT result=value
Pattern: Conditional Branch
[ClassName] methodName: condition branch=TAKEN/SKIPPED reason=why
Pattern: Loop Iteration
[ClassName] methodName: loop iteration=N/total item=current
Pattern: State Transition
[ClassName] methodName: state from=oldState to=newState trigger=event
Pattern: Async Operation
[ClassName] operationName: START [ClassName] operationName: SUCCESS result=summary [ClassName] operationName: ERROR error=message
Quick Selection Guide
Debugging Flutter/Dart app? -> See
references/dart-flutter.md
Debugging Android native (Kotlin)? -> See
references/kotlin-android.md
Debugging iOS native (Swift)? -> See
references/swift-ios.md
Debugging web/Node.js/React? -> See
references/javascript-typescript.md
Best Practices
- Be specific - Include actual values, not just "value changed"
- Be consistent - Use the same format throughout the codebase
- Be temporary - Remove debug logs after issue is resolved
- Be contextual - Include enough info to understand without seeing code
- Be careful with sensitive data - Never log passwords, tokens, PII
References
- Dart/Flutter logging patternsreferences/dart-flutter.md
- Kotlin/Android logging patternsreferences/kotlin-android.md
- Swift/iOS logging patternsreferences/swift-ios.md
- JavaScript/TypeScript logging patternsreferences/javascript-typescript.md