mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 13:54:36 +00:00
Fix null log messages being dropped
This commit is contained in:
parent
8e6da3c8d0
commit
14d3e926a0
1 changed files with 21 additions and 10 deletions
|
@ -111,6 +111,8 @@ namespace BirthdayBot
|
|||
private Task Client_Log(LogMessage arg)
|
||||
{
|
||||
// Suppress certain messages
|
||||
if (arg.Message != null)
|
||||
{
|
||||
if (arg.Message.StartsWith("Unknown Dispatch ")) return Task.CompletedTask;
|
||||
switch (arg.Message) // Connection status messages replaced by ShardManager's output
|
||||
{
|
||||
|
@ -121,10 +123,19 @@ namespace BirthdayBot
|
|||
case "Resumed previous session":
|
||||
case "Disconnecting":
|
||||
case "Disconnected":
|
||||
case "WebSocket connection was closed":
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
if (arg.Message == "Heartbeat Errored")
|
||||
{
|
||||
// Replace this with a custom message; do not show stack trace
|
||||
Log("Discord.Net", $"{arg.Severity}: {arg.Message} - {arg.Exception.Message}");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Log("Discord.Net", $"{arg.Severity}: {arg.Message}");
|
||||
}
|
||||
|
||||
if (arg.Exception != null) Log("Discord.Net", arg.Exception.ToString());
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
|
Loading…
Reference in a new issue