From d0b4af6ccc41a0bfad1f8425ee2ca60295b165bb Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 30 Apr 2024 15:30:48 +0200 Subject: [PATCH] improve logs when build with NEXTCLOUD_DEV enabled Signed-off-by: Matthieu Gallien --- config.h.in | 2 ++ src/gui/application.cpp | 5 +++++ src/libsync/logger.cpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.h.in b/config.h.in index ca9907c52f29..d7f561525beb 100644 --- a/config.h.in +++ b/config.h.in @@ -61,4 +61,6 @@ #cmakedefine CFAPI_SHELL_EXTENSIONS_LIB_NAME "@CFAPI_SHELL_EXTENSIONS_LIB_NAME@" +#cmakedefine01 NEXTCLOUD_DEV + #endif diff --git a/src/gui/application.cpp b/src/gui/application.cpp index d15f470cfb0a..0b49a2e93e54 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -699,8 +699,13 @@ void Application::setupLogging() logger->setLogDir(_logDir.isEmpty() ? ConfigFile().logDir() : _logDir); } logger->setLogExpire(_logExpire > 0 ? _logExpire : ConfigFile().logExpire()); +#if defined NEXTCLOUD_DEV + logger->setLogFlush(true); + logger->setLogDebug(true); +#else logger->setLogFlush(_logFlush || ConfigFile().logFlush()); logger->setLogDebug(_logDebug || ConfigFile().logDebug()); +#endif if (!logger->isLoggingToFile() && ConfigFile().automaticLogDir()) { logger->setupTemporaryFolderLogDir(); } diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 5db0535ca087..64acb2b7b465 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -118,7 +118,7 @@ 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(QT_DEBUG) +#if defined Q_OS_WIN && (defined NEXTCLOUD_DEV || defined QT_DEBUG) // write logs to Output window of Visual Studio { QString prefix;