From b25e9f881376e95d9d17a810244870856123bb04 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 27 Aug 2025 14:17:57 +0200 Subject: [PATCH] Fix up conditions for BEM Builds --- .../Utils/Logger/SptLogger.cs | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs index 2dc635eb..fa9be5ed 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Logger/SptLogger.cs @@ -25,7 +25,21 @@ public class SptLogger : ISptLogger, IDisposable _category = typeof(T).FullName; _loggerQueueManager = loggerQueueManager; - LoadConfig(fileUtil, jsonUtil, ProgramStatics.DEBUG() ? ConfigurationPathDev : ConfigurationPath); + bool IsReleaseType = ProgramStatics.ENTRY_TYPE() switch + { + Models.Enums.EntryType.BLEEDINGEDGEMODS => true, + Models.Enums.EntryType.RELEASE => true, + _ => false, + }; + + if (!ProgramStatics.DEBUG() || IsReleaseType) + { + LoadConfig(fileUtil, jsonUtil, ConfigurationPath); + } + else + { + LoadConfig(fileUtil, jsonUtil, ConfigurationPathDev); + } if (_config == null) { @@ -35,15 +49,15 @@ public class SptLogger : ISptLogger, IDisposable _loggerQueueManager.Initialize(_config); } - private void LoadConfig(FileUtil fileUtil, JsonUtil jsonUtil, string sptloggerDevelopmentJson) + private void LoadConfig(FileUtil fileUtil, JsonUtil jsonUtil, string sptLoggerJson) { - if (fileUtil.FileExists(sptloggerDevelopmentJson)) + if (fileUtil.FileExists(sptLoggerJson)) { - _config = jsonUtil.DeserializeFromFile(sptloggerDevelopmentJson); + _config = jsonUtil.DeserializeFromFile(sptLoggerJson); } else { - throw new Exception($"Unable to find SPTLogger file '{sptloggerDevelopmentJson}'"); + throw new Exception($"Unable to find SPTLogger file '{sptLoggerJson}'"); } }