关于 filterLogType

filterLogType默认设置是Log,会显示所有类型的Log。

Warning:会显示Warning,Assert,Error,Exception

Assert:会显示Assert,Error,Exception

Error:显示Error和Exception

Exception:只会显示Exception

 

使用:

using UnityEngine;

public class Test : MonoBehaviour
{
private BoxCollider boxCollider;
void Start()
{
DebugTrace.Instance.SetLogOptions(true, 2, editorCreate: true); //设置日志打开 显示2帧 并且编辑器下产生日志
DebugTrace.Instance.StartTrace();
Debug.Log("log");
Debug.Log("log", this);
Debug.LogError("LogError");
Debug.LogAssertion("LogAssertion");

boxCollider.enabled = false; //报错 发布后捕捉不到帧
}

private void OnApplicationQuit()
{
DebugTrace.Instance.CloseTrace();
}
}
如果在编辑器中也设置产生日志,日志文件在当前项目路径下,打包后在exe同级目录下

在打包发布后某些数据会获取不到 例如行号 参考:

 

最后看下效果:

 

posted @ 2019-10-12 13:37  水至清明  阅读(483)  评论(0编辑  收藏  举报