mirror of
https://github.com/NoiTheCat/WorldTime.git
synced 2024-11-24 09:24:13 +00:00
Update logging filters
This commit is contained in:
parent
ad756ae83b
commit
88bdf8103e
1 changed files with 13 additions and 11 deletions
24
WorldTime.cs
24
WorldTime.cs
|
@ -120,19 +120,17 @@ internal class WorldTime : IDisposable {
|
||||||
private Task DiscordClient_Log(LogMessage arg) {
|
private Task DiscordClient_Log(LogMessage arg) {
|
||||||
// Suppress certain messages
|
// Suppress certain messages
|
||||||
if (arg.Message != null) {
|
if (arg.Message != null) {
|
||||||
//switch (arg.Message)
|
switch (arg.Message) {
|
||||||
//{
|
case "Connecting":
|
||||||
// case "Connecting":
|
case "Connected":
|
||||||
// case "Connected":
|
case "Ready":
|
||||||
// case "Ready":
|
|
||||||
// case "Failed to resume previous session":
|
// case "Failed to resume previous session":
|
||||||
// case "Resumed previous session":
|
// case "Resumed previous session":
|
||||||
// case "Disconnecting":
|
case "Disconnecting":
|
||||||
// case "Disconnected":
|
case "Disconnected":
|
||||||
// case "WebSocket connection was closed":
|
// case "WebSocket connection was closed":
|
||||||
// case "Server requested a reconnect":
|
return Task.CompletedTask;
|
||||||
// return Task.CompletedTask;
|
}
|
||||||
//}
|
|
||||||
if (arg.Message == "Heartbeat Errored") {
|
if (arg.Message == "Heartbeat Errored") {
|
||||||
// Replace this with a custom message; do not show stack trace
|
// Replace this with a custom message; do not show stack trace
|
||||||
Program.Log("Discord.Net", $"{arg.Severity}: {arg.Message} - {arg.Exception.Message}");
|
Program.Log("Discord.Net", $"{arg.Severity}: {arg.Message} - {arg.Exception.Message}");
|
||||||
|
@ -142,7 +140,11 @@ internal class WorldTime : IDisposable {
|
||||||
Program.Log("Discord.Net", $"{arg.Severity}: {arg.Message}");
|
Program.Log("Discord.Net", $"{arg.Severity}: {arg.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg.Exception != null) Program.Log("Discord.Net exception", arg.Exception.ToString());
|
// Suppress certain exceptions
|
||||||
|
if (arg.Exception != null) {
|
||||||
|
if (arg.Exception is not GatewayReconnectException)
|
||||||
|
Program.Log("Discord.Net exception", arg.Exception.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue