update game log filters (#638)
This commit is contained in:
parent
a03137372d
commit
39214fd23f
|
@ -86,15 +86,20 @@ namespace StardewModdingAPI.Framework
|
||||||
/// <summary>Whether the program has been disposed.</summary>
|
/// <summary>Whether the program has been disposed.</summary>
|
||||||
private bool IsDisposed;
|
private bool IsDisposed;
|
||||||
|
|
||||||
/// <summary>Regex patterns which match console messages to suppress from the console and log.</summary>
|
/// <summary>Regex patterns which match console non-error messages to suppress from the console and log.</summary>
|
||||||
private readonly Regex[] SuppressConsolePatterns =
|
private readonly Regex[] SuppressConsolePatterns =
|
||||||
{
|
{
|
||||||
new Regex(@"^TextBox\.Selected is now '(?:True|False)'\.$", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
new Regex(@"^TextBox\.Selected is now '(?:True|False)'\.$", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
||||||
new Regex(@"^(?:FRUIT )?TREE: IsClient:(?:True|False) randomOutput: \d+$", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
new Regex(@"^(?:FRUIT )?TREE: IsClient:(?:True|False) randomOutput: \d+$", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
||||||
new Regex(@"^loadPreferences\(\); begin", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
new Regex(@"^loadPreferences\(\); begin", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
||||||
new Regex(@"^savePreferences\(\); async=", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
new Regex(@"^savePreferences\(\); async=", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
||||||
new Regex(@"^DebugOutput:\s+(?:added CLOUD|added cricket|dismount tile|Ping|playerPos)", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
new Regex(@"^DebugOutput:\s+(?:added CLOUD|added cricket|dismount tile|Ping|playerPos)", RegexOptions.Compiled | RegexOptions.CultureInvariant)
|
||||||
new Regex(@"^static SerializableDictionary<.+>\(\) called\.$", RegexOptions.Compiled | RegexOptions.CultureInvariant),
|
};
|
||||||
|
|
||||||
|
/// <summary>Regex patterns which match console error messages to suppress from the console and log.</summary>
|
||||||
|
private readonly Regex[] SuppressConsoleErrorPatterns =
|
||||||
|
{
|
||||||
|
new Regex(@"^Error loading schedule data for (?:Bouncer|Dwarf|Gunther|Krobus|Marlon|Mister Qi|Sandy|Wizard): .+ ---> System\.IO\.FileNotFoundException", RegexOptions.Compiled | RegexOptions.CultureInvariant)
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>Regex patterns which match console messages to show a more friendly error for.</summary>
|
/// <summary>Regex patterns which match console messages to show a more friendly error for.</summary>
|
||||||
|
@ -1347,6 +1352,8 @@ namespace StardewModdingAPI.Framework
|
||||||
// ignore suppressed message
|
// ignore suppressed message
|
||||||
if (level != LogLevel.Error && this.SuppressConsolePatterns.Any(p => p.IsMatch(message)))
|
if (level != LogLevel.Error && this.SuppressConsolePatterns.Any(p => p.IsMatch(message)))
|
||||||
return;
|
return;
|
||||||
|
if (level == LogLevel.Error && this.SuppressConsoleErrorPatterns.Any(p => p.IsMatch(message)))
|
||||||
|
return;
|
||||||
|
|
||||||
// show friendly error if applicable
|
// show friendly error if applicable
|
||||||
foreach (var entry in this.ReplaceConsolePatterns)
|
foreach (var entry in this.ReplaceConsolePatterns)
|
||||||
|
|
Loading…
Reference in New Issue