Skip to content

Commit

Permalink
Merge pull request #7273 from nextcloud/backport/7263/stable-3.13
Browse files Browse the repository at this point in the history
[stable-3.13] remove too verbose logs during discovery
  • Loading branch information
mgallien authored Oct 7, 2024
2 parents d809304 + 48452e6 commit 08175cc
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/common/remotepermissions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<int>(qHash(activity._subject + activity._message));
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion src/libsync/cookiejar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const
QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl &url) const
{
QList<QNetworkCookie> cookies = QNetworkCookieJar::cookiesForUrl(url);
qCDebug(lcCookieJar) << url << "requests:" << cookies;
return cookies;
}

Expand Down
16 changes: 0 additions & 16 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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));
}

Expand Down
8 changes: 0 additions & 8 deletions src/libsync/owncloudpropagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<BulkPropagatorJob>(propagator(), propagator()->delayedTasks());
propagator()->clearDelayedTasks();
Expand Down
1 change: 0 additions & 1 deletion src/libsync/syncfileitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 08175cc

Please sign in to comment.