コード例 #1
0
        static void AddLog(LogEntry logEntry)
        {
            if (CheckNewFrame())
            {
                logEntry.id = LogEntry.currentId++;
            }

            threadLogEntries.AddThreadSafe(logEntry);
        }
コード例 #2
0
ファイル: HtmlDebug.cs プロジェクト: raulet-dev/retro-royale
        void UnityDebugLogThread(string logString, string stackTraceString, LogType logType)
        {
            if (!isLogEnabled || sw == null)
            {
                return;
            }

            int  threadId     = Thread.CurrentThread.ManagedThreadId;
            bool isMainThread = (threadId == mainThreadId);

            bool useStackTrace = UseStackTrace(logType);

            logsThread.AddThreadSafe(new Log()
            {
                logString = logString, stackTraceString = stackTraceString, logType = logType, isMainThread = isMainThread, threadId = threadId, stackTrace = (useStackTrace ? new System.Diagnostics.StackTrace(skipFrames, true) : null)
            });

            if (isMainThread && updateLogCallFromMainThread)
            {
                UpdateLogs();
            }
        }