zoukankan      html  css  js  c++  java
  • 关于 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同级目录下

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

    最后看下效果:

  • 相关阅读:
    2020年9月29日
    随机生成验证码
    动手动脑java语法基础
    Java语法之动手实验
    代码大全2 读书笔记
    java动手动动脑之字串联接
    二柱子问题
    生成随机四则运算1
    可变参数
    2020年9月30日
  • 原文地址:https://www.cnblogs.com/hyhy904/p/11661041.html
Copyright © 2011-2022 走看看