Show Discord RPC logs on debug only

This commit is contained in:
Alessandro Proto 2023-02-02 19:02:16 +01:00
parent 732311a730
commit 9b5d463f4a

View file

@ -3,6 +3,7 @@ using DiscordRPC;
using DiscordRPC.Logging;
using DiscordRPC.Message;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
@ -21,15 +22,15 @@ public class DiscordIntegration : IPlugin
_configuration = configuration;
var discordConfig = _configuration.GetSection("Integrations:Discord");
Client = new(discordConfig["ApplicationId"])
{
Logger = new ConsoleLogger() { Level = LogLevel.Warning }
};
Capy64.Instance.Discord = this;
Client = new(discordConfig["ApplicationId"]);
#if DEBUG
Client.Logger = new ConsoleLogger() { Level = DiscordRPC.Logging.LogLevel.Info };
Client.OnReady += OnReady;
Client.OnPresenceUpdate += OnPresenceUpdate;
#endif
Capy64.Instance.Discord = this;
if (discordConfig.GetValue("Enable", false))
{