From 007c517a77a6b554b8d4d96da1c2b635f70e4dd7 Mon Sep 17 00:00:00 2001 From: ju5tA1ex <134963295+bingmapsts@users.noreply.github.com> Date: Sun, 14 Jun 2026 20:06:03 +0300 Subject: [PATCH 1/2] Logs are optional --- src/dll/Utils.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dll/Utils.cpp b/src/dll/Utils.cpp index 59de31b3..b3399434 100644 --- a/src/dll/Utils.cpp +++ b/src/dll/Utils.cpp @@ -13,6 +13,15 @@ std::shared_ptr Utils::CreateLogger(const std::wstring_view aLog const Paths& aPaths, const Config& aConfig, const DevConsole& aDevConsole) { + const auto& loggingConfig = aConfig.GetLogging(); + + if (loggingConfig.level == spdlog::level::level_enum::off) + { + std::vector sinks; + + return std::make_shared("dummy_logger", begin(sinks), end(sinks)); + } + try { auto dir = aPaths.GetLogsDir(); @@ -53,7 +62,6 @@ std::shared_ptr Utils::CreateLogger(const std::wstring_view aLog constexpr auto oneKbInB = 1024 * oneByte; constexpr auto oneMbInB = 1024 * oneKbInB; - const auto& loggingConfig = aConfig.GetLogging(); const size_t maxFiles = loggingConfig.maxFiles; const size_t maxFileSize = static_cast(loggingConfig.maxFileSize) * oneMbInB; From 2d29e9bb32e045f692779be6c82e95f2806cfb8e Mon Sep 17 00:00:00 2001 From: ju5tA1ex <134963295+bingmapsts@users.noreply.github.com> Date: Sun, 14 Jun 2026 21:14:14 +0300 Subject: [PATCH 2/2] Update Utils.cpp --- src/dll/Utils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dll/Utils.cpp b/src/dll/Utils.cpp index b3399434..193f695e 100644 --- a/src/dll/Utils.cpp +++ b/src/dll/Utils.cpp @@ -18,8 +18,11 @@ std::shared_ptr Utils::CreateLogger(const std::wstring_view aLog if (loggingConfig.level == spdlog::level::level_enum::off) { std::vector sinks; - - return std::make_shared("dummy_logger", begin(sinks), end(sinks)); + auto logger = std::make_shared("dummy_logger", begin(sinks), end(sinks)); + logger->set_level(spdlog::level::level_enum::off); + logger->flush_on(loggingConfig.flushOn); + + return logger; } try