thread-safe logger
Signed-off-by: KosmX <kosmx.mc@gmail.com>
This commit is contained in:
parent
deed49574a
commit
ec5bb944b2
2 changed files with 4 additions and 0 deletions
|
@ -150,6 +150,8 @@ namespace {
|
|||
/** This is used so that we can output to the log file in addition to the CLI. */
|
||||
void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||
{
|
||||
const std::lock_guard<std::mutex> lock(APPLICATION->loggerMutex); // synchronized, QFile logFile is not thread-safe
|
||||
|
||||
QString out = qFormatLogMessage(type, context, msg);
|
||||
out += QChar::LineFeed;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue