From 9b5d463f4a5ac66f5e3b92529791c265fd88bef7 Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Thu, 2 Feb 2023 19:02:16 +0100 Subject: [PATCH] Show Discord RPC logs on debug only --- Capy64/Integrations/DiscordIntegration.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Capy64/Integrations/DiscordIntegration.cs b/Capy64/Integrations/DiscordIntegration.cs index eb19c6f..c824ae5 100644 --- a/Capy64/Integrations/DiscordIntegration.cs +++ b/Capy64/Integrations/DiscordIntegration.cs @@ -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)) {