Extension Logs

Debug Filter isn’t limited to Unity’s built-in Debug.Log, Debug.LogWarning, or Debug.LogError calls you can easily integrate your own custom logging methods using the [DebugFilter] attribute.

When you add [DebugFilter] above a custom method that internally calls Debug.Log, Debug Filter automatically recognizes that method as a valid “debug wrapper.” During scanning, the system traces these wrappers and includes every log they generate inside the Debug Filter window, just like native Unity logs.

This allows you to keep your own structured logging systems (e.g., Logger.Info(), Logger.Error(), Logger.Success()) without losing Debug Filter compatibility.


🔧 Example Integration

Now, any script that calls your custom methods like:

…will automatically appear in the Debug Filter window, fully categorized by method, script, and folder.


⚙️ How It Works Under the Hood

When the Unity Editor starts, Debug Filter replaces the default ILogHandler with its own DFLogHandler. Each time a log is generated, the handler inspects the call stack to determine which script and line produced it. If a wrapper method (like Logger.Info) is marked with [DebugFilter], Debug Filter treats it as a valid passthrough instead of skipping it meaning the originating call (from your gameplay code) is correctly captured and mapped.

Without the attribute, the system would normally ignore all wrapper classes to avoid listing internal library logs. With [DebugFilter], you explicitly tell the scanner:

“This method is part of my debug workflow include it.”


🎯 Benefits

  • Custom Logger Support – Works seamlessly with your own logging utilities and frameworks.

  • Accurate Stack Tracing – Keeps the correct script, method, and line reference even when routed through wrappers.

  • Full Integration – Custom logs appear with color coding, filtering, and folder grouping just like Unity logs.

  • Clean Workflow – You can maintain your preferred logging style (Logger.Info, DebugX.Print, etc.) without sacrificing central management.

  • Editor-Only – The system remains fully editor-side; nothing affects your builds or runtime behavior.


💡 Tips

  • Always place [DebugFilter] directly above the custom method that calls Unity’s Debug.Log.

  • You can use multiple attributes across a shared logging class each method can be individually recognized.

  • Keep your wrappers lightweight; avoid complex logic inside them to preserve accurate call tracing.

  • Combine with Script Filter to view only the folder or system where your wrapper is used (e.g., “Logger”, “Analytics”, or “UI”).


In short: Adding the [DebugFilter] attribute bridges your custom logging system with the Debug Filter tool making all your extended logs visible, searchable, and manageable from one unified editor window.

Last updated