Пример #1
0
 // 战斗日志,都是主线程中发送
 public void fightLog(string message)
 {
     if (MThread.isMainThread())
     {
         foreach (LogDeviceBase logDevice in m_fightLogDeviceList)
         {
             logDevice.logout(message, LogColor.LOG);
         }
     }
 }
Пример #2
0
        public void logout(string message, LogColor type = LogColor.LOG)
        {
        #if THREAD_CALLCHECK
            MThread.needMainThread();
        #endif

            if (m_bOutLog)
            {
                foreach (LogDeviceBase logDevice in m_logDeviceList)
                {
                    logDevice.logout(message, type);
                }
            }
        }
Пример #3
0
 public void log(string message)
 {
     //StackTrace stackTrace = new StackTrace(true);
     //string traceStr = stackTrace.ToString();
     //message = string.Format("{0}\n{1}", message, traceStr);
     if (MThread.isMainThread())
     {
         logout(message, LogColor.LOG);
     }
     else
     {
         asyncLog(message);
     }
 }
Пример #4
0
        public void error(string message)
        {
            StackTrace stackTrace = new StackTrace(true);
            string     traceStr   = stackTrace.ToString();

            message = string.Format("{0}\n{1}", message, traceStr);

            if (MThread.isMainThread())
            {
                logout(message, LogColor.ERROR);
            }
            else
            {
                asyncError(message);
            }
        }
Пример #5
0
        public void updateLog()
        {
        #if THREAD_CALLCHECK
            MThread.needMainThread();
        #endif

            while ((m_tmpStr = m_asyncLogList.RemoveAt(0)) != default(string))
            {
                logout(m_tmpStr, LogColor.LOG);
            }

            while ((m_tmpStr = m_asyncWarnList.RemoveAt(0)) != default(string))
            {
                logout(m_tmpStr, LogColor.LOG);
            }

            while ((m_tmpStr = m_asyncErrorList.RemoveAt(0)) != default(string))
            {
                logout(m_tmpStr, LogColor.LOG);
            }
        }