improve logs when build with NEXTCLOUD_DEV enabled

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
pull/6718/head
Matthieu Gallien 2024-04-30 15:30:48 +02:00 committed by Matthieu Gallien
parent 75d0e9aebe
commit d0b4af6ccc
3 changed files with 8 additions and 1 deletions

View File

@ -61,4 +61,6 @@
#cmakedefine CFAPI_SHELL_EXTENSIONS_LIB_NAME "@CFAPI_SHELL_EXTENSIONS_LIB_NAME@"
#cmakedefine01 NEXTCLOUD_DEV
#endif

View File

@ -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();
}

View File

@ -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;