From 2776e0ecc67f04a10c905bbebd2b5f5346bb7fc6 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 3 Oct 2024 16:53:55 +0200 Subject: [PATCH 1/5] remove too verbose logs during discovery will make the logs less verbose and improve performance Signed-off-by: Matthieu Gallien --- src/libsync/discoveryphase.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 02722ceedac9b..142b4470d9eaf 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -565,7 +565,6 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(const QString &fi auto perm = RemotePermissions::fromServerString(map.value("permissions"), _account->serverHasMountRootProperty() ? RemotePermissions::MountedPermissionAlgorithm::UseMountRootProperty : RemotePermissions::MountedPermissionAlgorithm::WildGuessMountedSubProperty, map); - qCInfo(lcDiscovery()) << file << map.value("permissions") << map; emit firstDirectoryPermissions(perm); _isExternalStorage = perm.hasPermission(RemotePermissions::IsMounted); } @@ -600,7 +599,6 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(const QString &fi if (result.isDirectory) result.size = 0; - qCInfo(lcDiscovery()) << file << map.value("permissions") << result.remotePerm.toString() << map; _results.push_back(std::move(result)); } From 24fdf070fcfa48e022e85bda4280a83c20a8d238 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 3 Oct 2024 18:11:01 +0200 Subject: [PATCH 2/5] remove useless internal log about remote permissions management Signed-off-by: Matthieu Gallien --- src/common/remotepermissions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/remotepermissions.cpp b/src/common/remotepermissions.cpp index bfe93922a679c..c1e6ebcd7d691 100644 --- a/src/common/remotepermissions.cpp +++ b/src/common/remotepermissions.cpp @@ -92,7 +92,6 @@ RemotePermissions RemotePermissions::internalFromServerString(const QString &val So replace the 'M' by a 'm' for every sub entries in an external storage */ perm.unsetPermission(RemotePermissions::IsMounted); perm.setPermission(RemotePermissions::IsMountedSub); - qCInfo(lcRemotePermissions()) << otherProperties.value(QStringLiteral("permissions")) << "replacing M permissions by m for subfolders inside a group folder"; } return perm; From d545cd3a92319ef426390f713047dd72be04d59c Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 3 Oct 2024 18:28:08 +0200 Subject: [PATCH 3/5] remove too verbose not so usefull logs Signed-off-by: Matthieu Gallien --- src/libsync/cookiejar.cpp | 1 - src/libsync/discovery.cpp | 16 ---------------- src/libsync/syncfileitem.cpp | 1 - 3 files changed, 18 deletions(-) diff --git a/src/libsync/cookiejar.cpp b/src/libsync/cookiejar.cpp index 7e6158f845c53..f0e3bca10ca53 100644 --- a/src/libsync/cookiejar.cpp +++ b/src/libsync/cookiejar.cpp @@ -87,7 +87,6 @@ bool CookieJar::setCookiesFromUrl(const QList &cookieList, const QList CookieJar::cookiesForUrl(const QUrl &url) const { QList cookies = QNetworkCookieJar::cookiesForUrl(url); - qCDebug(lcCookieJar) << url << "requests:" << cookies; return cookies; } diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index ebb4a925a5435..eac483715047b 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -674,16 +674,6 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(const SyncFileItemPtr &it item->_lockTimeout = serverEntry.lockTimeout; item->_lockToken = serverEntry.lockToken; - qCDebug(lcDisco()) << "item lock for:" << item->_file - << item->_locked - << item->_lockOwnerDisplayName - << item->_lockOwnerId - << item->_lockOwnerType - << item->_lockEditorApp - << item->_lockTime - << item->_lockTimeout - << item->_lockToken; - // Check for missing server data { QStringList missingData; @@ -711,18 +701,12 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(const SyncFileItemPtr &it // Add on a second as a precaution, sometimes we catch the server before it has had a chance to update const auto lockExpirationTimeout = qMax(5LL, timeRemaining + 1); - qCDebug(lcDisco) << "File:" << path._original << "is locked." - << "Lock expires in:" << lockExpirationTimeout << "seconds." - << "A sync run will be scheduled for around that time."; - _discoveryData->_anotherSyncNeeded = true; _discoveryData->_filesNeedingScheduledSync.insert(path._original, lockExpirationTimeout); } else if (serverEntry.locked == SyncFileItem::LockStatus::UnlockedItem && dbEntry._lockstate._locked) { // We have received data that this file has been unlocked remotely, so let's notify the sync engine // that we no longer need a scheduled sync run for this file - qCInfo(lcDisco) << "File:" << path._original << "is unlocked and a scheduled sync is no longer needed." - << "Will remove scheduled sync if there is one."; _discoveryData->_filesUnscheduleSync.append(path._original); } diff --git a/src/libsync/syncfileitem.cpp b/src/libsync/syncfileitem.cpp index 6b32a5fae1ceb..c21c930660506 100644 --- a/src/libsync/syncfileitem.cpp +++ b/src/libsync/syncfileitem.cpp @@ -130,7 +130,6 @@ SyncJournalFileRecord SyncFileItem::toSyncJournalFileRecordWithInode(const QStri // Update the inode if possible rec._inode = _inode; if (FileSystem::getInode(localFileName, &rec._inode)) { - qCDebug(lcFileItem) << localFileName << "Retrieved inode " << rec._inode << "(previous item inode: " << _inode << ")"; } else { // use the "old" inode coming with the item for the case where the // filesystem stat fails. That can happen if the the file was removed From b4a2d76604ff2dda158cf0cda4f48bcec02b5d93 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 3 Oct 2024 18:32:45 +0200 Subject: [PATCH 4/5] remove internal logs in propagation scheduler: not usefull Signed-off-by: Matthieu Gallien --- src/libsync/owncloudpropagator.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index 069478033f553..7dd277849821e 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -1580,8 +1580,6 @@ void PropagateRootDirectory::appendDirDeletionJob(PropagatorJob *job) bool PropagateRootDirectory::scheduleSelfOrChild() { - qCInfo(lcRootDirectory()) << "scheduleSelfOrChild" << _state << "pending uploads" << propagator()->delayedTasks().size() << "subjobs state" << _subJobs._state; - if (_state == Finished) { return false; } @@ -1604,8 +1602,6 @@ bool PropagateRootDirectory::scheduleSelfOrChild() void PropagateRootDirectory::slotSubJobsFinished(SyncFileItem::Status status) { - qCInfo(lcRootDirectory()) << status << "slotSubJobsFinished" << _state << "pending uploads" << propagator()->delayedTasks().size() << "subjobs state" << _subJobs._state; - if (!propagator()->delayedTasks().empty()) { scheduleDelayedJobs(); return; @@ -1620,7 +1616,6 @@ void PropagateRootDirectory::slotSubJobsFinished(SyncFileItem::Status status) // Synchronously abort abort(AbortType::Synchronous); _state = Finished; - qCInfo(lcPropagator) << "PropagateRootDirectory::slotSubJobsFinished" << "emit finished" << status; emit finished(status); } return; @@ -1654,18 +1649,15 @@ void PropagateRootDirectory::slotSubJobsFinished(SyncFileItem::Status status) void PropagateRootDirectory::slotDirDeletionJobsFinished(SyncFileItem::Status status) { if (_errorStatus != SyncFileItem::NoStatus && status == SyncFileItem::Success) { - qCInfo(lcPropagator) << "PropagateRootDirectory::slotDirDeletionJobsFinished" << "reporting previous error" << _errorStatus; status = _errorStatus; } _state = Finished; - qCInfo(lcPropagator) << "PropagateRootDirectory::slotDirDeletionJobsFinished" << "emit finished" << status; emit finished(status); } bool PropagateRootDirectory::scheduleDelayedJobs() { - qCInfo(lcPropagator) << "PropagateRootDirectory::scheduleDelayedJobs"; propagator()->setScheduleDelayedTasks(true); auto bulkPropagatorJob = std::make_unique(propagator(), propagator()->delayedTasks()); propagator()->clearDelayedTasks(); From 48452e68c361305548dd8526431d50426c7ebd51 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 3 Oct 2024 18:42:11 +0200 Subject: [PATCH 5/5] downgrade severity level of logs during propagation Signed-off-by: Matthieu Gallien --- src/gui/tray/usermodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 062a19e3b5ecb..fb482e983ddc9 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -803,7 +803,7 @@ void User::processCompletedSyncItem(const Folder *folder, const SyncFileItemPtr activity._fileAction = fileActionFromInstruction(item->_instruction); if (item->_status == SyncFileItem::NoStatus || item->_status == SyncFileItem::Success) { - qCWarning(lcActivity) << "Item " << item->_file << " retrieved successfully."; + qCDebug(lcActivity) << "Item " << item->_file << " retrieved successfully."; if (item->_direction != SyncFileItem::Up) { activity._message = QObject::tr("Synced %1").arg(fileName); @@ -838,7 +838,7 @@ void User::processCompletedSyncItem(const Folder *folder, const SyncFileItemPtr _activityModel->addSyncFileItemToActivityList(activity); } else { - qCWarning(lcActivity) << "Item " << item->_file << " retrieved resulted in error " << item->_errorString; + qCInfo(lcActivity) << "Item " << item->_file << " retrieved resulted in error " << item->_errorString; activity._subject = item->_errorString; activity._id = -static_cast(qHash(activity._subject + activity._message)); @@ -876,7 +876,7 @@ void User::slotItemCompleted(const QString &folder, const SyncFileItemPtr &item) return; } - qCWarning(lcActivity) << "Item " << item->_file << " retrieved resulted in " << item->_errorString; + qCDebug(lcActivity) << "Item " << item->_file << " retrieved resulted in " << item->_errorString; processCompletedSyncItem(folderInstance, item); }