Skip to content

Commit

Permalink
fix log mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniTurtle committed Apr 12, 2024
1 parent d943bf6 commit ad78c23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ void Logger::logToOutputs(LogLevel lev, const std::string &combined,
const std::string &time, const std::string &thread_name,
const std::string &payload_text)
{
logOutputData.push_back({ lev, combined, time, thread_name, payload_text });
{
MutexAutoLock lock(m_mutex);
logOutputData.push_back({ lev, combined, time, thread_name, payload_text });
}
flushLogToOutputs();
}

Expand Down

0 comments on commit ad78c23

Please sign in to comment.