Update log message filtering

This commit is contained in:
Noi 2022-03-30 21:50:58 -07:00
parent bc2553ffad
commit 7ee4ff7ad1

View file

@ -92,14 +92,18 @@ public sealed class ShardInstance : IDisposable {
case "Disconnected": case "Disconnected":
case "Resumed previous session": case "Resumed previous session":
case "Failed to resume previous session": case "Failed to resume previous session":
case "Discord.WebSocket.GatewayReconnectException: Server requested a reconnect": case "Serializer Error": // The exception associated with this log appears a lot as of v3.2-ish
return Task.CompletedTask; return Task.CompletedTask;
} }
Log("Discord.Net", $"{arg.Severity}: {arg.Message}"); Log("Discord.Net", $"{arg.Severity}: {arg.Message}");
} }
if (arg.Exception != null) Log("Discord.Net exception", arg.Exception.ToString()); if (arg.Exception != null) {
if (arg.Exception is GatewayReconnectException
|| arg.Exception.Message == "WebSocket connection was closed") return Task.CompletedTask;
Log("Discord.Net exception", arg.Exception.ToString());
}
return Task.CompletedTask; return Task.CompletedTask;
} }