diff --git a/Common/Log/LogManager.cpp b/Common/Log/LogManager.cpp index f44e2c6ce0..d07e7c381b 100644 --- a/Common/Log/LogManager.cpp +++ b/Common/Log/LogManager.cpp @@ -418,7 +418,6 @@ void LogManager::StdioLog(const LogMessage &message) { __android_log_print(mode, LOG_APP_NAME, "%.*s", (int)msg.size(), msg.data()); } #else - std::lock_guard lock(stdioLock_); char text[2048]; snprintf(text, sizeof(text), "%s %s %s", message.timestamp, message.header, message.msg.c_str()); text[sizeof(text) - 2] = '\n'; @@ -449,6 +448,8 @@ void LogManager::StdioLog(const LogMessage &message) { break; } } + + std::lock_guard lock(stdioLock_); fprintf(stderr, "%s%s%s", colorAttr, text, resetAttr); #endif }