示例#1
0
 private static void InternalSafeLog(LogType type, LOG_CHANNEL channel, string message)
 {
     lock (s_Lock)
     {
         DebugData data = new DebugData(channel, message, type);
         m_WaitingList.Add(data);
     }
 }
示例#2
0
        public static void DebugLog(LOG_CHANNEL channel, string message)
        {
            string content = CoreLogger.Debug(channel, message);

            if (OnLogReceived != null)
            {
                OnLogReceived(channel, LogType.Log, content);
            }
        }
示例#3
0
        public static void Error(LOG_CHANNEL channel, string message, UnityEngine.Object context = null)
        {
            string content = CoreLogger.Error(channel, message);

            if (OnLogReceived != null)
            {
                OnLogReceived(channel, LogType.Error, content);
            }
        }
示例#4
0
        public static void EnableLogChannel(LOG_CHANNEL channel, bool bEnable)
        {
            if (!m_dictLogFlag.ContainsKey(channel))
            {
                return;
            }

            m_dictLogFlag[channel] = bEnable;
        }
示例#5
0
        private static string GetLogText(LOG_CHANNEL channel, string strLog)
        {
            if (!IsLogActive(channel))
            {
                return(null);
            }

            return(string.Format("<color=yellow>{0}{1}</color>: {2}", channel, Time.frameCount, strLog));
        }
示例#6
0
        public static string Error(LOG_CHANNEL channel, string strLog)
        {
            string strErrorLog = GetLogText(channel, strLog);

            if (strErrorLog == null)
            {
                return(strErrorLog);
            }

            UnityEngine.Debug.LogError(strErrorLog);
            return(strErrorLog);
        }
示例#7
0
        public static string Warning(LOG_CHANNEL channel, string strLog)
        {
            string strWarning = GetLogText(channel, strLog);

            if (strWarning == null)
            {
                return(strWarning);
            }

            UnityEngine.Debug.LogWarning(strWarning);
            return(strWarning);
        }
示例#8
0
        public static bool IsLogActive(LOG_CHANNEL channel)
        {
            if (!m_bLogShow)
            {
                return(false);
            }

            if (!m_bLogInit)
            {
                return(true);
            }

            if (!m_dictLogFlag.ContainsKey(channel))
            {
                return(false);
            }

            return(m_dictLogFlag[channel]);
        }
示例#9
0
 public static void SafeError(LOG_CHANNEL channel, string message)
 {
     InternalSafeLog(LogType.Error, channel, message);
 }
示例#10
0
 public static void SafeWarning(LOG_CHANNEL channel, string message)
 {
     InternalSafeLog(LogType.Warning, channel, message);
 }
示例#11
0
 public static void SafeDebugLog(LOG_CHANNEL channel, string message)
 {
     InternalSafeLog(LogType.Log, channel, message);
 }
示例#12
0
 public DebugData(LOG_CHANNEL channel, string message, LogType type)
 {
     this.channel = channel;
     this.message = message;
     this.type    = type;
 }
示例#13
0
        public static void LogFormat(LOG_CHANNEL channel, string message, params object[] paramList)
        {
            string message2 = string.Format(message, paramList);

            DebugLog(channel, message2);
        }