Skip to content

Commit

Permalink
Merge pull request #5410 from nextcloud/feature/terminal-logging
Browse files Browse the repository at this point in the history
Log to stdout when built in Debug config
  • Loading branch information
claucambra authored Feb 13, 2023
2 parents 7953d4e + 4d9fef8 commit 7da0c2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libsync/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Logger::Logger(QObject *parent)
_crashLog.resize(CrashLogSize);
#ifndef NO_MSG_HANDLER
qInstallMessageHandler([](QtMsgType type, const QMessageLogContext &ctx, const QString &message) {
Logger::instance()->doLog(type, ctx, message);
});
Logger::instance()->doLog(type, ctx, message);
});
#endif
}

Expand Down Expand Up @@ -112,6 +112,9 @@ void Logger::doLog(QtMsgType type, const QMessageLogContext &ctx, const QString
msgW.append(L"\n");
OutputDebugString(msgW.c_str());
}
#elif defined(QT_DEBUG)
QTextStream cout(stdout, QIODevice::WriteOnly);
cout << msg << endl;
#endif
{
QMutexLocker lock(&_mutex);
Expand Down

0 comments on commit 7da0c2c

Please sign in to comment.