Awesome
Unity-File-Debug
Enhanced debug logging for Unity, with file export and HTML viewer.
Why
- Output Unity debug info to log files (csv, tsv, json, txt)
- A nice web interface to view the log files (csv, tsv, json)
- HTML5 (single file)
- No external dependencies
- Searchable via message, stacktrace, timestamp, logtype
- Filterable by logtype
- Be able to drop it into existing projects
How to use
- Import the latest release's package into your project
- Move the prefab
Unity File Debug
into your scene - Setup the filepath and settings in the inspector
- Copy the HTML to your output path via inspector button
- Use
Debug.Log
as normal, or for more advanced usage see Tester script inDemo
folder - 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
- Fork/clone this repository
- Open in Unity
- Hack away
How to Customize
Custom log types
- Change DLogType enumeration in DebugWrapper.cs
- Update
topLogTypes
andnestedLogTypes
arrays in UnityFileDebugViewer.html - Update
LogTypeColors
css in UnityFileDebugViewer.html - Update svg icons in UnityFileDebugViewer.html
No nesting in viewer
- Move all elements from
nestedLogTypes
array totopLogTypes
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.