mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #4099 from Dimon4eg/write_logs_to_Output_window_of_Visual_Studio
write logs to Output window of Visual Studio
This commit is contained in:
commit
f2d075f3ca
@ -89,6 +89,30 @@ bool Logger::isLoggingToFile() const
|
||||
void Logger::doLog(QtMsgType type, const QMessageLogContext &ctx, const QString &message)
|
||||
{
|
||||
const QString msg = qFormatLogMessage(type, ctx, message);
|
||||
#if defined(Q_OS_WIN) && defined(QT_DEBUG)
|
||||
// write logs to Output window of Visual Studio
|
||||
{
|
||||
QString prefix;
|
||||
switch (type) {
|
||||
case QtDebugMsg:
|
||||
break;
|
||||
case QtInfoMsg:
|
||||
break;
|
||||
case QtWarningMsg:
|
||||
prefix = QStringLiteral("[WARNING] ");
|
||||
break;
|
||||
case QtCriticalMsg:
|
||||
prefix = QStringLiteral("[CRITICAL ERROR] ");
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
prefix = QStringLiteral("[FATAL ERROR] ");
|
||||
break;
|
||||
}
|
||||
auto msgW = QString(prefix + message).toStdWString();
|
||||
msgW.append(L"\n");
|
||||
OutputDebugString(msgW.c_str());
|
||||
}
|
||||
#endif
|
||||
{
|
||||
QMutexLocker lock(&_mutex);
|
||||
_crashLogIndex = (_crashLogIndex + 1) % CrashLogSize;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user