Home

Awesome

Unity-File-Debug

Unity Version  Platform  GitHub license  GitHub release  GitHub issues  Pull Requests 

Enhanced debug logging for Unity, with file export and HTML viewer.

Why

How to use

  1. Import the latest release's package into your project
  2. Move the prefab Unity File Debug into your scene
  3. Setup the filepath and settings in the inspector
  4. Copy the HTML to your output path via inspector button
  5. Use Debug.Log as normal, or for more advanced usage see Tester script in Demo folder
  6. Open the UnityFileDebugViewer.html file from your log folder, browse for a log file from the top left

If you don't specify an absolute filepath, Application.persistentDataPath will be used.

HTML viewer is designed for modern browsers (chrome/firefox)

Developing

How to Customize

Custom log types

  1. Change DLogType enumeration in DebugWrapper.cs
  2. Update topLogTypes and nestedLogTypes arrays in UnityFileDebugViewer.html
  3. Update LogTypeColors css in UnityFileDebugViewer.html
  4. Update svg icons in UnityFileDebugViewer.html

No nesting in viewer

  1. Move all elements from nestedLogTypes array to topLogTypes in UnityFileDebugViewer.html

Using other log sources

The viewer supports a few different file formats

JSON format:
{
  t: '', // type
  tm: '', // time
  l: '', // log message
  s: '', // log stack trace
}
CSV header:

type,time,log,stack

TSV header:

type time log stack


Release

In the Unity Editor, click the menu option SSS/Util/Package/Unity File Debug. The UnityFileDebug.unitypackage will be in the root of this project.

<!-- Badge References --> <!-- URL References -->