fix logger creating file when logging to file disabled

v1
Brett 2023-02-08 14:21:21 -05:00
parent f1cb6f05f5
commit 2a5314be57
1 changed files with 2 additions and 1 deletions

View File

@ -102,6 +102,7 @@ namespace blt::logging {
void init(LOG_PROPERTIES properties) { void init(LOG_PROPERTIES properties) {
if (BLT_LOGGING_PROPERTIES.m_directory != properties.m_directory) if (BLT_LOGGING_PROPERTIES.m_directory != properties.m_directory)
writer = LogFileWriter{properties.m_directory}; writer = LogFileWriter{properties.m_directory};
if (properties.m_logToFile)
std::filesystem::create_directory(properties.m_directory); std::filesystem::create_directory(properties.m_directory);
BLT_LOGGING_PROPERTIES = properties; BLT_LOGGING_PROPERTIES = properties;
} }