diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp index b5865f0a..8d84840e 100644 --- a/src/debug/Log.cpp +++ b/src/debug/Log.cpp @@ -24,7 +24,9 @@ void Debug::log(eLogLevel level, std::string str) { if (m_shuttingDown) return; - std::string coloredStr = str; + std::lock_guard guard(m_logMutex); + + std::string coloredStr = str; //NOLINTBEGIN switch (level) { case LOG: diff --git a/src/debug/Log.hpp b/src/debug/Log.hpp index 6a380783..c3146805 100644 --- a/src/debug/Log.hpp +++ b/src/debug/Log.hpp @@ -42,8 +42,6 @@ namespace Debug { template //NOLINTNEXTLINE void log(eLogLevel level, std::format_string fmt, Args&&... args) { - std::lock_guard guard(m_logMutex); - if (level == TRACE && !m_trace) return;