From 6629774d832255505fcfd86347e1fe7b4d476f4c Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 12 May 2019 03:09:42 -0500 Subject: [PATCH] Added options to control log queue clearing --- IPA.Loader/Config/SelfConfig.cs | 2 ++ IPA.Loader/Logging/StandardLogger.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index d55bfcb7..3f116c11 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -51,6 +51,8 @@ namespace IPA.Config { public bool ShowCallSource = false; public bool ShowDebug = false; + public bool HideMessagesForPerformance = true; + public int HideLogThreshold = 512; } public DebugObject Debug = new DebugObject(); diff --git a/IPA.Loader/Logging/StandardLogger.cs b/IPA.Loader/Logging/StandardLogger.cs index 2c7f3f5f..460e132a 100644 --- a/IPA.Loader/Logging/StandardLogger.cs +++ b/IPA.Loader/Logging/StandardLogger.cs @@ -294,7 +294,10 @@ namespace IPA.Logging } } - if (logQueue.Count > 512) + var debugConfig = SelfConfig.SelfConfigRef.Value.Debug; + + if (debugConfig.HideMessagesForPerformance + && logQueue.Count > debugConfig.HideLogThreshold) { // spam filtering (if queue has more tha 512 elements) logWaitEvent.Reset(); // pause incoming log requests