mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
Add exception logging for dropped connections
This commit is contained in:
parent
6a55555e48
commit
93a52ff95a
1 changed files with 7 additions and 0 deletions
|
|
@ -150,6 +150,7 @@ namespace PluralKit.Bot
|
||||||
|
|
||||||
public Task Init()
|
public Task Init()
|
||||||
{
|
{
|
||||||
|
_client.ShardDisconnected += ShardDisconnected;
|
||||||
_client.ShardReady += ShardReady;
|
_client.ShardReady += ShardReady;
|
||||||
_client.Log += FrameworkLog;
|
_client.Log += FrameworkLog;
|
||||||
|
|
||||||
|
|
@ -164,6 +165,12 @@ namespace PluralKit.Bot
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Task ShardDisconnected(Exception ex, DiscordSocketClient shard)
|
||||||
|
{
|
||||||
|
_logger.Warning(ex, $"Shard #{shard.ShardId} disconnected");
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
private Task FrameworkLog(LogMessage msg)
|
private Task FrameworkLog(LogMessage msg)
|
||||||
{
|
{
|
||||||
// Bridge D.NET logging to Serilog
|
// Bridge D.NET logging to Serilog
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue