예제 #1
0
파일: DebugUtils.cs 프로젝트: lizijie/ufk
        public static void Startup()
        {
            // 自定义日志处理实例
            if (string.IsNullOrEmpty(LogFilePath))
            {
                LogFilePath = GenDefaultLogFilePath();
            }

            try
            {
                s_writer = new DebugWriter(LogFilePath);
            }
            catch (Exception e)
            {
                Debug.LogWarning("文件操作失败 " + e.ToString());
                if (s_writer != null)
                {
                    s_writer.Dispose();
                }
                return;
            }

            Application.logMessageReceived         -= LogCallback;
            Application.logMessageReceived         += LogCallback;
            Application.logMessageReceivedThreaded -= LogCallback;
            Application.logMessageReceivedThreaded += LogCallback;
        }
예제 #2
0
파일: DebugUtils.cs 프로젝트: lizijie/ufk
 public static void Release()
 {
     if (s_writer != null)
     {
         s_writer.Dispose();
     }
     s_writer = null;
 }