Exemple #1
0
 public static void Log(string str)
 {
     str = GetLogFormat(str);
     if (useLog)
     {
         Debug.Log(str);
     }
     else if (logger != null)
     {
         logger.Log(str, string.Empty, (LogType)3);
     }
     StringPool.Collect(str);
 }
 public void LogError(string msg)
 {
     if (!enable || !Debuger.enable)
     {
         return;
     }
     lock (_lock)
     {
         msg = GetLogFormat(msg, LogType.Error);
         Debug.LogError(msg);
         StringPool.Collect(msg);
     }
 }
Exemple #3
0
    private void Update()
    {
        //Profiler.BeginSample("CString");
        //using (CString.Block())
        //{
        //}

        //Profiler.EndSample();
        string hello = StringPool.Alloc(5);

        TestBlock(hello);
        StringPool.Collect(hello);
    }
Exemple #4
0
 public static void LogWarning(string str)
 {
     str = GetLogFormat(str);
     if (useLog)
     {
         Debug.LogWarning(str);
     }
     else if (logger != null)
     {
         string stack = StackTraceUtility.ExtractStackTrace();
         logger.Log(str, stack, (LogType)2);
     }
     StringPool.Collect(str);
 }
Exemple #5
0
 public static void LogException(string str, Exception e)
 {
     threadStack = e.StackTrace;
     str         = GetLogFormat(str + e.Message);
     if (useLog)
     {
         Debug.LogError(str);
     }
     else if (logger != null)
     {
         logger.Log(str, threadStack, (LogType)4);
     }
     StringPool.Collect(str);
 }
Exemple #6
0
        public static void Log(string str)
        {
            str = GetLogFormat(str);

            if (useLog)
            {
                Debug.Log(str);
            }
            else if (logger != null)
            {
                //普通log节省一点记录堆栈性能和避免调用手机系统log函数
                logger.Log(str, string.Empty, LogType.Log);
            }

            StringPool.Collect(str);
        }