From: Matthieu Gallien Date: Tue, 13 Dec 2022 10:13:55 +0000 (+0100) Subject: use nextcloud.log suffix for log files of desktop client X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~11^2~62^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=31b2146a1768b33defa06e0a0413261e96a959e9;p=nextcloud-desktop.git use nextcloud.log suffix for log files of desktop client Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 294ad2bb6..608771748 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -301,12 +301,12 @@ void Logger::enterNextLogFile() // Tentative new log name, will be adjusted if one like this already exists QDateTime now = QDateTime::currentDateTime(); - QString newLogName = now.toString("yyyyMMdd_HHmm") + "_owncloud.log"; + QString newLogName = now.toString("yyyyMMdd_HHmm") + "_nextcloud.log"; // Expire old log files and deal with conflicts - QStringList files = dir.entryList(QStringList("*owncloud.log.*"), - QDir::Files, QDir::Name); - const QRegularExpression rx(QRegularExpression::anchoredPattern(R"(.*owncloud\.log\.(\d+).*)")); + QStringList files = dir.entryList(QStringList("*owncloud.log.*"), QDir::Files, QDir::Name) + + dir.entryList(QStringList("*nextcloud.log.*"), QDir::Files, QDir::Name); + const QRegularExpression rx(QRegularExpression::anchoredPattern(R"(.*(next|own)cloud\.log\.(\d+).*)")); int maxNumber = -1; foreach (const QString &s, files) { if (_logExpire > 0) { @@ -317,7 +317,7 @@ void Logger::enterNextLogFile() } const auto rxMatch = rx.match(s); if (s.startsWith(newLogName) && rxMatch.hasMatch()) { - maxNumber = qMax(maxNumber, rxMatch.captured(1).toInt()); + maxNumber = qMax(maxNumber, rxMatch.captured(2).toInt()); } } newLogName.append("." + QString::number(maxNumber + 1));