Merge pull request #802 from KosmX/develop
This commit is contained in:
commit
d2fd0fd8e8
@ -77,6 +77,7 @@
|
|||||||
#include "ApplicationMessage.h"
|
#include "ApplicationMessage.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
#include <QAccessible>
|
#include <QAccessible>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
@ -150,6 +151,9 @@ namespace {
|
|||||||
/** This is used so that we can output to the log file in addition to the CLI. */
|
/** 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)
|
void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
|
static std::mutex loggerMutex;
|
||||||
|
const std::lock_guard<std::mutex> lock(loggerMutex); // synchronized, QFile logFile is not thread-safe
|
||||||
|
|
||||||
QString out = qFormatLogMessage(type, context, msg);
|
QString out = qFormatLogMessage(type, context, msg);
|
||||||
out += QChar::LineFeed;
|
out += QChar::LineFeed;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user