From 2a5314be5782a25f39c8098ff8bb756c98412ce6 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 8 Feb 2023 14:21:21 -0500 Subject: [PATCH] fix logger creating file when logging to file disabled --- src/blt/std/logging.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blt/std/logging.cpp b/src/blt/std/logging.cpp index c6e29a3..b9bade2 100644 --- a/src/blt/std/logging.cpp +++ b/src/blt/std/logging.cpp @@ -102,7 +102,8 @@ namespace blt::logging { void init(LOG_PROPERTIES properties) { if (BLT_LOGGING_PROPERTIES.m_directory != properties.m_directory) writer = LogFileWriter{properties.m_directory}; - std::filesystem::create_directory(properties.m_directory); + if (properties.m_logToFile) + std::filesystem::create_directory(properties.m_directory); BLT_LOGGING_PROPERTIES = properties; }