public static void Error(string text, bool ignoreStopLoggingLimit = false) { if (!ignoreStopLoggingLimit && Log.ReachedMaxMessagesLimit) { return; } Debug.LogError(text); if (!Log.currentlyLoggingError) { Log.currentlyLoggingError = true; try { if (Prefs.PauseOnError && Current.ProgramState == ProgramState.Playing) { Find.TickManager.Pause(); } Log.messageQueue.Enqueue(new LogMessage(LogMessageType.Error, text, StackTraceUtility.ExtractStackTrace())); Log.PostMessage(); if (!PlayDataLoader.Loaded || Prefs.DevMode) { Log.TryOpenLogWindow(); } } catch (Exception arg) { Debug.LogError("An error occurred while logging an error: " + arg); } finally { Log.currentlyLoggingError = false; } } }
public static void Warning(string text, bool ignoreStopLoggingLimit = false) { if (ignoreStopLoggingLimit || !Log.ReachedMaxMessagesLimit) { Debug.LogWarning(text); Log.messageQueue.Enqueue(new LogMessage(LogMessageType.Warning, text, StackTraceUtility.ExtractStackTrace())); Log.PostMessage(); } }
public static void Message(string text, bool ignoreStopLoggingLimit = false) { if (!ignoreStopLoggingLimit && Log.ReachedMaxMessagesLimit) { return; } Debug.Log(text); Log.messageQueue.Enqueue(new LogMessage(LogMessageType.Message, text, StackTraceUtility.ExtractStackTrace())); Log.PostMessage(); }