- Home /
Skip custom loghandler in console window
Hi everybody, have a nice day.
Currently, I'm trying to custom my own log with loghandler. My testing log handler class is some thing like this :
public class MyLogger : ILogHandler {
private ILogHandler defaultLogHandler = Debug.logger.logHandler;
public MyLogger() {
}
public void LogFormat (LogType logType, UnityEngine.Object context, string format, params object[] args)
{
if (logType == LogType.Log)
format = "【DEBUG】 : <color=lime>{0}</color>";
else if (logType == LogType.Warning)
format = "【WARNING】: <color=yellow>{0}</color>";
else if (logType == LogType.Error)
format = "【ERROR】 : <color=red>{0}</color>";
defaultLogHandler.LogFormat (logType, context, format, args);
}
public void LogException (System.Exception exception, UnityEngine.Object context)
{
defaultLogHandler.LogException (exception, context);
}
}
And when the logged result has show, I double click the record on the console window, it's always return to this handler class, and all I want is when I double click to the record on console window, I can direct to where I called logger.Log("Some testing"). I think something like skip the handler class???
This is what I got when using this custom:
【DEBUG】 : <color=lime>OK</color>
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
Asset.Common.Script.MyLogger:LogFormat(LogType, Object, String, Object[]) (at Assets/Scripts/Common/Logger/MyLogger.cs:23)
UnityEngine.Logger:Log(Object)
...
And this is Unity default log:
Add Live2D Model : 1
UnityEngine.Debug:Log(Object)
LAppLive2DManager:AddModel(LAppModelProxy) (at Assets/Scripts/Live2d/sample/LAppLive2DManager.cs:50)
LAppModelProxy:Awake() (at Assets/Scripts/Live2d/sample/LAppModelProxy.cs:33)
Thank you, and sorry for my bad english.
Your answer
Follow this Question
Related Questions
How can i connect to the asset store? 2 Answers
Script Reference Problem... 1 Answer
Outputting multi line strings to console? 2 Answers
how to show debug.log messages in visual studio output window? 0 Answers
Editor log doesn't match console log? 0 Answers