| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using System.IO; |
| | | using System.Threading; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public class RunTimeExceptionUtility : Singleton<RunTimeExceptionUtility> |
| | | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using System;
|
| | | using System.IO;
|
| | | using System.Threading;
|
| | |
|
| | |
|
| | | public class RunTimeExceptionUtility : Singleton<RunTimeExceptionUtility>
|
| | |
|
| | | {
|
| | |
|
| | | List<string> logWriteToFileTemp = new List<string>();
|
| | | DateTime nextWriteFileTime = DateTime.Now;
|
| | | string logFileRoot = string.Empty; |
| | | |
| | | string logFileRoot = string.Empty;
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= OnPerSecond;
|
| | |
| | |
|
| | | GlobalTimeEvent.Instance.secondEvent += OnPerSecond;
|
| | | Application.logMessageReceivedThreaded += AddLogRenderer;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | public void UnInit()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= OnPerSecond;
|
| | | Application.logMessageReceivedThreaded -= AddLogRenderer;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | private void AddLogRenderer(string _log, string _callStack, LogType _type)
|
| | | {
|
| | | logWriteToFileTemp.Add(string.Format("{0}--{1}:Thread:{2}-{3};{4}{5}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), _type, Thread.CurrentThread.ManagedThreadId, _log, _callStack, "\r\n"));
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | private void OnPerSecond()
|
| | | {
|
| | | if (DateTime.Now > nextWriteFileTime)
|
| | |
| | | logWriteToFileTemp.Clear();
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | |
| | | } |
| | | }
|
| | |
|
| | |
|
| | | }
|