From 2865259a6a1e06c1f5a30e5900b965a9322ae35e Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 6 Jun 2020 22:06:32 +0200 Subject: [PATCH] Enable SK2 debug only with debugging config, not just debug build --- ArchiSteamFarm/Bot.cs | 2 +- ArchiSteamFarm/Program.cs | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 7e94697d2..80da0fdfe 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -234,7 +234,7 @@ namespace ArchiSteamFarm { // Initialize SteamClient = new SteamClient(SteamConfiguration, botName); - if (Debugging.IsUserDebugging && Directory.Exists(SharedInfo.DebugDirectory)) { + if (Debugging.IsDebugConfigured && Directory.Exists(SharedInfo.DebugDirectory)) { string debugListenerPath = Path.Combine(SharedInfo.DebugDirectory, botName); try { diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index a5f0509d1..52698038f 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -324,15 +324,17 @@ namespace ArchiSteamFarm { Logging.EnableTraceLogging(); - DebugLog.AddListener(new Debugging.DebugListener()); - DebugLog.Enabled = true; + if (Debugging.IsDebugConfigured) { + DebugLog.AddListener(new Debugging.DebugListener()); + DebugLog.Enabled = true; - if (Directory.Exists(SharedInfo.DebugDirectory)) { - try { - Directory.Delete(SharedInfo.DebugDirectory, true); - await Task.Delay(1000).ConfigureAwait(false); // Dirty workaround giving Windows some time to sync - } catch (Exception e) { - ASF.ArchiLogger.LogGenericException(e); + if (Directory.Exists(SharedInfo.DebugDirectory)) { + try { + Directory.Delete(SharedInfo.DebugDirectory, true); + await Task.Delay(1000).ConfigureAwait(false); // Dirty workaround giving Windows some time to sync + } catch (Exception e) { + ASF.ArchiLogger.LogGenericException(e); + } } }