Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/fix log issues #7259

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ void Application::setupLogging()
logger->setLogDir(_logDir.isEmpty() ? ConfigFile().logDir() : _logDir);
}
logger->setLogExpire(_logExpire > 0 ? _logExpire : ConfigFile().logExpire());
#if defined NEXTCLOUD_DEV
#if defined NEXTCLOUD_DEV && NEXTCLOUD_DEV
logger->setLogFlush(true);
logger->setLogDebug(true);
#else
Expand Down
21 changes: 2 additions & 19 deletions src/libsync/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,27 +120,10 @@ void Logger::doLog(QtMsgType type, const QMessageLogContext &ctx, const QString
{
static long long int linesCounter = 0;
const auto &msg = qFormatLogMessage(type, ctx, message);
#if defined Q_OS_WIN && (defined NEXTCLOUD_DEV || defined QT_DEBUG)
#if defined Q_OS_WIN && ((defined NEXTCLOUD_DEV && NEXTCLOUD_DEV) || 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");
const auto msgW = QStringLiteral("%1\n").arg(msg).toStdWString();
OutputDebugString(msgW.c_str());
}
#endif
Expand Down
Loading