Browse Source

Added options to control log queue clearing

pull/11/head
Anairkoen Schno 5 years ago
parent
commit
6629774d83
2 changed files with 6 additions and 1 deletions
  1. +2
    -0
      IPA.Loader/Config/SelfConfig.cs
  2. +4
    -1
      IPA.Loader/Logging/StandardLogger.cs

+ 2
- 0
IPA.Loader/Config/SelfConfig.cs View File

@ -51,6 +51,8 @@ namespace IPA.Config
{ {
public bool ShowCallSource = false; public bool ShowCallSource = false;
public bool ShowDebug = false; public bool ShowDebug = false;
public bool HideMessagesForPerformance = true;
public int HideLogThreshold = 512;
} }
public DebugObject Debug = new DebugObject(); public DebugObject Debug = new DebugObject();


+ 4
- 1
IPA.Loader/Logging/StandardLogger.cs View File

@ -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) { // spam filtering (if queue has more tha 512 elements)
logWaitEvent.Reset(); // pause incoming log requests logWaitEvent.Reset(); // pause incoming log requests


Loading…
Cancel
Save