예제 #1
0
        void WriteLogs(object callback)
        {
            try
            {
                logs.GrabListThreadSafe(logsThread, true);

                for (int i = 0; i < logs.Count; i++)
                {
                    Log log = logs.items[i];
                    UnityDebugLog(log.logString, log.stackTraceString, log.logType, log.isMainThread, log.threadId, log.stackTrace);
                }

                logs.FastClear();
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }
            finally
            {
                isLogging = false;
            }
        }
예제 #2
0
        void UpdateLogs()
        {
            logEntries.GrabListThreadSafe(threadLogEntries);

            for (int i = 0; i < logEntries.Count; i++)
            {
                LogEntry logEntry = logEntries.items[i];

                if (logEntry.entryType == EntryType.Unity)
                {
                    if (logEntry.logType == LogType.Log)
                    {
                        instance.windowData.logIcon.count++;
                        lastFrameEntry.flag |= (int)Flag.Log;
                        logs[unityLogs].cullItems.Add(logEntry);
                    }
                    else if (logEntry.logType == LogType.Warning)
                    {
                        if (instance.showConsoleOnWarning && !show)
                        {
                            SetActive(true);
                        }
                        instance.windowData.warningIcon.count++;
                        lastFrameEntry.flag |= (int)Flag.Warning;
                        logs[warningLogs].cullItems.Add(logEntry);
                    }
                    else if (logEntry.logType == LogType.Error)
                    {
                        if (instance.showConsoleOnError && !show)
                        {
                            SetActive(true);
                        }
                        instance.windowData.errorIcon.count++;
                        lastFrameEntry.flag |= (int)Flag.Error;
                        logs[errorLogs].cullItems.Add(logEntry);
                    }
                    else if (logEntry.logType == LogType.Exception)
                    {
                        if (instance.showConsoleOnException && !show)
                        {
                            SetActive(true);
                        }
                        instance.windowData.exceptionIcon.count++;
                        lastFrameEntry.flag |= (int)Flag.Exception;
                        logs[exceptionLogs].cullItems.Add(logEntry);
                    }
                }
                else if (logEntry.entryType == EntryType.Frame)
                {
                    logs[frameLogs].cullItems.Add(lastFrameEntry);
                }
                else
                {
                    lastFrameEntry.flag |= (int)Flag.Command;
                    logs[commandLogs].cullItems.Add(logEntry);
                }
            }

            logEntries.Clear();

            instance.CalcDraw(false);
        }