Ejemplo n.º 1
0
    private void _CollectByCondition()
    {
        this._collectedLogDatas.Clear();
        int showLogCount = (int)this._condition.ShowLogCount;

        for (int i = this._logDatas.Count - 1; i >= 0; i--)
        {
            TsLog.LogData logData = this._logDatas[i];
            if (showLogCount >= this._collectedLogDatas.Count)
            {
                bool flag = this._condition.FilterRef.IsPassByFilter(logData.message);
                bool flag2;
                if (this._condition.LogType == TsLog.ELogType.ALL)
                {
                    flag2 = true;
                }
                else if (this._condition.LogType == TsLog.ELogType.ALL_Except_Log)
                {
                    flag2 = (logData.logType != TsLog.ELogType.Log);
                }
                else
                {
                    flag2 = (this._condition.LogType == logData.logType);
                }
                if (flag && flag2)
                {
                    this._collectedLogDatas.Insert(0, logData);
                }
            }
        }
    }
Ejemplo n.º 2
0
 public static TsLog.LogData Create_CompileLog(TsLog.ELogType logType, string compileLog)
 {
     TsLog.LogData logData = TsLog.LogData.Create(logType, compileLog, string.Empty);
     if (logData != null)
     {
         try
         {
             int    num  = compileLog.IndexOf('(');
             int    num2 = compileLog.IndexOf(',');
             string text = compileLog.Substring(0, num);
             string s    = compileLog.Substring(num + 1, num2 - num - 1);
             int    num3;
             if (!int.TryParse(s, out num3))
             {
                 num3 = 0;
             }
             TsLog.LogData.FrameInfo frameInfo = new TsLog.LogData.FrameInfo(string.Format("{0} : {1}", text, num3), text, num3);
             logData.frameInfos.Insert(0, frameInfo);
             logData.activeFrameInfo = frameInfo;
         }
         catch
         {
         }
     }
     return(logData);
 }
Ejemplo n.º 3
0
 public void GetSafetyLog(ref int collectedLogIndex, ref TsLog.LogData returnLog)
 {
     collectedLogIndex = Mathf.Max(collectedLogIndex, this._collectedLogDatas.Count);
     collectedLogIndex = Mathf.Min(collectedLogIndex, 0);
     if (this._collectedLogDatas.Count >= 1)
     {
         returnLog = this._collectedLogDatas[collectedLogIndex];
     }
 }
Ejemplo n.º 4
0
 private void _LogFromUnity(TsLog.LogData logData)
 {
     if (logData.logType == TsLog.ELogType.Error || logData.logType == TsLog.ELogType.Assert || logData.logType == TsLog.ELogType.Exception)
     {
         this.isErrorPause = true;
     }
     if (Application.isEditor)
     {
         this._condition.Clear();
         if (this._logDatas.Count >= TsLog.MAX_LogCount)
         {
             this._logDatas.RemoveAt(0);
         }
         this._logDatas.Add(logData);
     }
     if (this._eventLog != null)
     {
         this._eventLog(logData);
     }
 }
Ejemplo n.º 5
0
 public bool IsSelected(TsLog.LogData log)
 {
     return(this.SelectedLog == log);
 }
Ejemplo n.º 6
0
        public static TsLog.LogData Create(TsLog.ELogType logType, string message, string stackTrace)
        {
            TsLog.LogData logData = new TsLog.LogData();
            try
            {
                logData.logType = logType;
                logData.message = message;
            }
            catch (Exception ex)
            {
                logData.logType = TsLog.ELogType.Error;
                logData.message = "param���ڸ� Ȯ�����ּ���~!! exception= " + ex.ToString();
            }
            logData.time         = Time.time;
            logData.frame        = Time.frameCount;
            logData.usedHeapSize = Profiler.usedHeapSize;
            logData.stackInfos   = TsLog.LogData.CreateStackInfo(stackTrace);
            logData.frameInfos   = new List <TsLog.LogData.FrameInfo>();
            bool          flag          = false;
            StringBuilder stringBuilder = new StringBuilder(128);

            foreach (TsLog.LogData.StackInfo current in logData.stackInfos)
            {
                string text = current.fileName;
                if (!string.IsNullOrEmpty(text))
                {
                    int num = text.IndexOf("Assets");
                    if (num != -1)
                    {
                        if (logData.activeFrameInfo == null)
                        {
                            flag = true;
                        }
                    }
                    else
                    {
                        num = text.IndexOf("Editor");
                    }
                    if (num != -1)
                    {
                        text = text.Substring(num);
                    }
                }
                stringBuilder.Remove(0, stringBuilder.Length);
                stringBuilder.AppendFormat("{0}.{1}()", Path.GetFileNameWithoutExtension(text), current.methodName);
                TsLog.LogData.FrameInfo frameInfo = new TsLog.LogData.FrameInfo(string.Format("{0}   [{1}] : {2}", stringBuilder, text, current.lineNum), text, current.lineNum);
                logData.frameInfos.Add(frameInfo);
                if (flag)
                {
                    logData.activeFrameInfo = frameInfo;
                    flag = false;
                }
            }
            if (logData.activeFrameInfo == null)
            {
                if (logData.frameInfos.Count <= 0)
                {
                    logData.activeFrameInfo = TsLog.LogData.DummyFrameInfo;
                }
                else
                {
                    logData.activeFrameInfo = logData.frameInfos[0];
                }
            }
            return(logData);
        }