Enable SK2 debug only with debugging config, not just debug build

This commit is contained in:
JustArchi
2020-06-06 22:06:32 +02:00
parent cb6c5e2de2
commit 2865259a6a
2 changed files with 11 additions and 9 deletions

View File

@@ -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 {

View File

@@ -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);
}
}
}