Git Product home page Git Product logo

unity-file-debug's Introduction

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

  • 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

  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

  • Fork/clone this repository
  • Open in Unity
  • Hack away

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.

unity-file-debug's People

Contributors

frozenfire92 avatar vutdang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

unity-file-debug's Issues

Ingame Scroll View

Nice asset - what do you think about the option to write the output to an ingame scroll view rather than a file?

I work on a remote Android device where it would be much easier to see exceptions etc. directly on screen rather than connecting + browsing through the file system.

ArgumentOutOfRangeException: Length cannot be less than zero.

When I use your asset, There is a bug "ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length".

ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
System.String.Substring (System.Int32 startIndex, System.Int32 length) (at :0)
SSS.UnityFileDebug.UnityFileDebug.HandleLog (System.String logString, System.String stackTrace, UnityEngine.LogType type) (at Assets/Cmn/UnityFileDebug/Lib/Logger/Scripts/UnityFileDebug.cs:118)
UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) (at C:/buildslave/unity/build/Runtime/Export/Application/Application.cs:121)
UnityEngine.MonoBehaviour:.ctor()

can you help me solve this issue?

HMD Bug in Steam VR (Open VR)

It seems that the logger does not handle the repositioning of assets within the scene - when the HMD is removed, the elements are somehow repositioned which makes the logger crash.
Stacktrace:
ArgumentOutOfRangeException: Cannot be negative. Parameter name: length System.String.Substring (Int32 startIndex, Int32 length) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:348) SSS.UnityFileDebug.UnityFileDebug.HandleLog (System.String logString, System.String stackTrace, LogType type) (at Assets/UnityFileDebug/Lib/Logger/Scripts/UnityFileDebug.cs:118) UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, LogType type, Boolean invokedOnMainThread) (at C:/buildslave/unity/build/Runtime/Export/Application.cs:121) UnityEngine.Debug:Log(Object) Valve.VR.InteractionSystem.Player:Update() (at Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs:291)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.