Logging Skill — Structured Unity Logging with AI
Unstructured Debug.Log("here") calls are unreadable in production and useless for filtering. The logging skill teaches your AI assistant to review, restructure, and improve all Debug.Log usage in your Unity code.
This skill is standalone — it works on any Unity project, with or without Jahro installed. It teaches structured logging principles based on criticality tiers, boundary-based placement, and a machine-readable format that makes logs filterable in any viewer.
What the skill does
When you ask your AI to review logging in a file or set up logging conventions, it:
- Scans your code for logging antipatterns (10 documented patterns)
- Classifies each system by criticality tier (critical / gameplay / infrastructure)
- Restructures logs into
[Tag] Action — key=valueformat - Places logs at system boundaries (entry, exit, error, state change) instead of inside loops
- Generates logging infrastructure:
LogTagconstants and an optional formatting helper
Example prompts
"Review the logging in my SaveManager"
"Set up logging conventions for our project"
"This file has too many Debug.Log calls — clean it up"
"Add structured logging to my NetworkManager"
What the AI generates
Given a typical Unity class with scattered Debug.Log calls, the AI restructures them into a consistent format.
Before:
public class SaveManager : MonoBehaviour
{
public void Save(string slot)
{
Debug.Log("saving...");
var data = Serialize();
Debug.Log("serialized");
WriteFile(slot, data);
Debug.Log("done");
}
}After:
public class SaveManager : MonoBehaviour
{
public void Save(string slot)
{
Debug.Log($"[Save] Begin — slot={slot}");
var data = Serialize();
WriteFile(slot, data);
Debug.Log($"[Save] Complete — slot={slot} bytes={data.Length}");
}
}The restructured logs:
- Use a
[Tag]prefix for filtering - Log at boundaries (start and end), not at every intermediate step
- Include contextual key-value pairs
- Remove noise that doesn't aid debugging
Key concepts
Structured format
[Tag] Action — key=value, key=value
Every log line follows this pattern. The tag enables filtering, the action describes what happened, and key-value pairs carry context.
Criticality tiers
The skill classifies systems by how much logging they need:
| Tier | Systems | Logging level |
|---|---|---|
| Critical | Saves, purchases, authentication, networking | Verbose — log every boundary, include full context |
| Gameplay | Player movement, AI, combat, UI interactions | Moderate — log state changes and errors |
| Infrastructure | Asset loading, pooling, audio, analytics | Minimal — log errors and initialization only |
Boundary rule
Logs belong at system boundaries: entry, exit, error, and state transitions. Logging inside tight loops or per-frame updates creates noise without adding diagnostic value.
10 antipatterns the AI detects
- Bare
Debug.Log("here")with no context - Logging inside
Update()orFixedUpdate() - String concatenation in hot paths (allocations)
- Missing error context (catch blocks without the exception)
- Duplicate log messages across branches
- Log-and-rethrow without added context
- Inconsistent tag formats
- Logging sensitive data (passwords, tokens)
- Conditional logging that's always true/false
- Using
Debug.Logfor values that should be watched (→ suggests[JahroWatch])
LogTag constants
The skill generates a centralized constants class for your project:
public static class LogTag
{
public const string Save = "[Save]";
public const string Network = "[Network]";
public const string Player = "[Player]";
public const string Combat = "[Combat]";
}Using constants instead of string literals prevents tag typos and enables IDE autocomplete.
Verification
After the AI restructures your logging:
- Search your project for bare
Debug.Log("calls — count should drop significantly - Verify logs use consistent
[Tag] Action — key=valueformat - Run your game and check the console output is readable and filterable
- Confirm no logging in
Update()/FixedUpdate()unless explicitly needed
How this connects to Jahro
Structured logs with consistent tags become filterable in Jahro's in-game log viewer and web console. The [Tag] prefix maps directly to Jahro's search and filter capabilities.
The skill mentions Jahro as an optional enhancement — you get value from structured logging regardless of which log viewer you use.
Frequently Asked Questions
Does the logging skill require Jahro? No. It works on any Unity project. The structured format improves readability in Unity's built-in console, Android Logcat, Xcode Console, or any log viewer. Jahro's log viewer and web console make the tags filterable, but they're not required.
What logging format does the skill use?
[Tag] Action — key=value, key=value. Example: [Save] Complete — slot=auto bytes=4096. This format is human-readable and machine-parseable.
How does the AI decide what criticality tier a system belongs to? The skill defines three tiers with example systems. Your AI matches your code against these examples — save systems and networking are critical, player movement and AI are gameplay, asset loading and pooling are infrastructure. You can override the classification in your prompt.
Can I use the logging skill alongside other logging frameworks?
Yes. The structured format works with any logging backend. If you use a custom logger instead of Debug.Log, tell your AI and it adapts the format to your API.
Related
- In-Game Log Viewer — view and filter structured logs on-device
- Web Console Logs — search and analyze logs in the browser
- Commands Skill — AI-generated runtime commands
- Agent Skills Overview — all 8 skills at a glance
- Install Agent Skills — setup instructions