private void TraceUpdate(DateTime a_dataTime, ETracerLevel a_level, string a_context, string a_file, int a_line)
        {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN
            netLogBuilder.Length = 0;
            netLogBuilder.Append(a_dataTime.ToString("[yyyy-MM-dd HH:mm:ss]"));
            netLogBuilder.Append("[" + a_level.ToString() + "]");
            netLogBuilder.Append(a_context);
            netLogBuilder.Append("[" + a_file + "(" + a_line.ToString() + ")]");
            using (System.IO.StreamWriter sw = System.IO.File.AppendText(netLogPath))
            {
                if (a_level >= ETracerLevel.WARN)
                {
                    UnityEngine.Debug.LogWarning(a_context + "[" + a_file + "(" + a_line.ToString() + ")]");
                }
                sw.WriteLine(netLogBuilder.ToString());
            }
#endif
        }
예제 #2
0
        private void _trace(ETracerLevel a_level, string a_context, string a_file, int a_line)
        {
            lock (m_traceQueue)
            {
                CTracerItem item = new CTracerItem();
                if (item == null)
                {
                    return;
                }
                item.m_dataTime = DateTime.Now;
                item.m_level    = a_level;
                item.m_file     = a_file;
                item.m_line     = a_line;
                item.m_context  = a_context;

                m_traceQueue.Enqueue(item);
            }
        }