enable/disable the filtering of non-warning log messages

This commit is contained in:
TheUbMunster 2022-12-24 20:29:19 -07:00
parent 3f6d581c83
commit 0b5d0b7c4e
2 changed files with 9 additions and 5 deletions

View File

@ -72,13 +72,16 @@ public class DiscordBot
{
//as time goes on, we may encounter logged info that we literally don't care about. Fill out an if statement to properly
//filter it out to avoid logging it to discord.
if (a.Message.Contains("Server requested a reconnect"))
if (localSettings.FilterOutNonIssueWarnings)
{
//This is to filter out this message. This warning is for discord server load balancing and isn't a problem
if (a.Message.Contains("Server requested a reconnect"))
{
//This is to filter out this message. This warning is for discord server load balancing and isn't a problem
//Warning[Discord: Gateway] Discord.WebSocket.GatewayReconnectException: Server requested a reconnect
//Warning[Discord: Gateway] at Discord.ConnectionManager.<> c__DisplayClass29_0.<< StartAsync > b__0 > d.MoveNext()
return;
//Warning[Discord: Gateway] Discord.WebSocket.GatewayReconnectException: Server requested a reconnect
//Warning[Discord: Gateway] at Discord.ConnectionManager.<> c__DisplayClass29_0.<< StartAsync > b__0 > d.MoveNext()
return;
}
}
string message = a.Message + (a.Exception != null ? "Exception: " + a.Exception.ToString() : "");
ConsoleColor col;

View File

@ -77,6 +77,7 @@ public class Settings {
[JsonProperty(PropertyName = "LogChannel")]
public string? AdminChannel { get; set; }
public bool LogCommands { get; set; } = false;
public bool FilterOutNonIssueWarnings { get; set; } = true;
}
public class ShineTable {