Created
March 3, 2014 14:58
-
-
Save takashicompany/9326753 to your computer and use it in GitHub Desktop.
Sample for Application.RegisterLogCallback (Unity)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Awake () | |
{ | |
Application.RegisterLogCallback(LogCallBackHandler); | |
} | |
void LogCallBackHandler(string condition, string stackTrace, LogType type) | |
{ | |
// condition : | |
// Debug.Log, Debug.LogWarning, Debug.LogError, Debug.LoeException Argument. | |
// stackTrace : | |
// UnityEngine.Debug:Log(Object) | |
// LogCallbaclkSample:OnGUI() (at Assets/LogCallbaclkSample.cs:45) | |
// LogType : | |
// LogType (enum). | |
System.Diagnostics.StackTrace systemStackTrace = new System.Diagnostics.StackTrace(true); | |
string systemStackTraceStr = systemStackTrace.ToString(); | |
// System.Diagnostics.StackTrace.toString() : | |
// at LogCallbaclkSample.LogCallBackHandler(System.String condition, System.String stackTrace, LogType type) in /Users/*****/Temp/LogCallBackSample/Assets/LogCallbaclkSample.cs:line 30 | |
// at UnityEngine.Application.CallLogCallback(System.String logString, System.String stackTrace, LogType type) | |
// at UnityEngine.Debug.Internal_Log(Int32 , System.String , UnityEngine.Object ) | |
// at UnityEngine.Debug.Log(System.Object message) | |
// at LogCallbaclkSample.OnGUI() in /Users/*****/Temp/LogCallBackSample/Assets/LogCallbaclkSample.cs:line 57 | |
SetLogData(condition, stackTrace,systemStackTraceStr, type); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment