Generate copy-paste Debug.Log snippets — [DBG] prefix, color tags, string interpolation, wrapped in UNITY_EDITOR guard. Read-only, never writes to project files. Triggers — 'debug log', 'add logging', 'trace log', 'log snippet', 'debug output'.
Install
npx skillscat add cuozg/oh-my-unity/unity-debug-log Install via the SkillsCat registry.
SKILL.md
unity-debug-log
Generate formatted Debug.Log snippets ready for manual copy-paste — never modifies project files directly.
When to Use
- Need a quick log statement to trace a value at a specific point
- Want color-coded, prefixed logs to stand out in the Console
- Generating log wrappers for methods, coroutines, or event handlers
- Adding temporary instrumentation without modifying file structure
Workflow
- Identify — determine what value/event/method to trace and in which class/method
- Format — apply [DBG] prefix, color tag, string interpolation, and UNITY_EDITOR guard
- Output — print the snippet as a code block (do not write to any project file)
Rules
- Never write snippets to project files — output only as text
- Always prefix with
[DBG]followed by class and method name - Always wrap in
#if UNITY_EDITOR/#endifunless user requests permanent logs - Use
$"..."string interpolation, not string concatenation - Apply
<color=X>tag to the prefix; keep message body uncolored for readability - Use
Debug.LogWarningfor unexpected-but-handled states,Debug.LogErrorfor failures - Include the calling context (
this.name, index, or key) when logging inside loops - Keep each snippet self-contained — no helper methods unless requested
- Do not suggest permanent logging infrastructure (that belongs in unity-code-quick)
- Load format examples if color codes or compound formats are needed
Output Format
Formatted code block(s) — copy-paste ready. Text output only.
Standards
Load unity-standards for logging guidance. Key references:
debug/log-format.md— [DBG] prefix, color tags, UNITY_EDITOR guarddebug/common-unity-errors.md— NRE, serialization, lifecycle, physics
Load via read_skill_file("unity-standards", "references/debug/<file>").