mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 21: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,20 +111,31 @@ namespace BirthdayBot
|
||||||
private Task Client_Log(LogMessage arg)
|
private Task Client_Log(LogMessage arg)
|
||||||
{
|
{
|
||||||
// Suppress certain messages
|
// Suppress certain messages
|
||||||
if (arg.Message.StartsWith("Unknown Dispatch ")) return Task.CompletedTask;
|
if (arg.Message != null)
|
||||||
switch (arg.Message) // Connection status messages replaced by ShardManager's output
|
|
||||||
{
|
{
|
||||||
case "Connecting":
|
if (arg.Message.StartsWith("Unknown Dispatch ")) return Task.CompletedTask;
|
||||||
case "Connected":
|
switch (arg.Message) // Connection status messages replaced by ShardManager's output
|
||||||
case "Ready":
|
{
|
||||||
case "Failed to resume previous session":
|
case "Connecting":
|
||||||
case "Resumed previous session":
|
case "Connected":
|
||||||
case "Disconnecting":
|
case "Ready":
|
||||||
case "Disconnected":
|
case "Failed to resume previous session":
|
||||||
|
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;
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("Discord.Net", $"{arg.Severity}: {arg.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
Log("Discord.Net", $"{arg.Severity}: {arg.Message}");
|
|
||||||
if (arg.Exception != null) Log("Discord.Net", arg.Exception.ToString());
|
if (arg.Exception != null) Log("Discord.Net", arg.Exception.ToString());
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
Loading…
Reference in a new issue