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:

  1. Scans your code for logging antipatterns (10 documented patterns)
  2. Classifies each system by criticality tier (critical / gameplay / infrastructure)
  3. Restructures logs into [Tag] Action — key=value format
  4. Places logs at system boundaries (entry, exit, error, state change) instead of inside loops
  5. Generates logging infrastructure: LogTag constants 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:

TierSystemsLogging level
CriticalSaves, purchases, authentication, networkingVerbose — log every boundary, include full context
GameplayPlayer movement, AI, combat, UI interactionsModerate — log state changes and errors
InfrastructureAsset loading, pooling, audio, analyticsMinimal — 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

  1. Bare Debug.Log("here") with no context
  2. Logging inside Update() or FixedUpdate()
  3. String concatenation in hot paths (allocations)
  4. Missing error context (catch blocks without the exception)
  5. Duplicate log messages across branches
  6. Log-and-rethrow without added context
  7. Inconsistent tag formats
  8. Logging sensitive data (passwords, tokens)
  9. Conditional logging that's always true/false
  10. Using Debug.Log for 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:

  1. Search your project for bare Debug.Log(" calls — count should drop significantly
  2. Verify logs use consistent [Tag] Action — key=value format
  3. Run your game and check the console output is readable and filterable
  4. 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.

Last updated: April 2, 2026