Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only use debug log level for discovery traces to decrease cost #7819

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1216,9 +1216,9 @@ void SyncEngine::setLocalDiscoveryOptions(LocalDiscoveryStyle style, std::set<QS
_localDiscoveryStyle = style;
_localDiscoveryPaths = std::move(paths);

if (lcEngine().isInfoEnabled() && !_localDiscoveryPaths.empty()) {
if (lcEngine().isDebugEnabled() && !_localDiscoveryPaths.empty()) {
// only execute if logging is enabled
auto debug = qInfo(lcEngine);
auto debug = qDebug(lcEngine);
debug << "paths to discover locally";
for (auto path : _localDiscoveryPaths) {
debug << path;
Expand Down Expand Up @@ -1275,12 +1275,12 @@ bool SyncEngine::shouldDiscoverLocally(const QString &path) const
if (it != _localDiscoveryPaths.begin() && path.startsWith(*(--it))) {
result = it->endsWith('/') || (path.size() > it->size() && path.at(it->size()) <= '/');
if (!result) {
qCInfo(lcEngine()) << path << "no local discovery needed";
qCDebug(lcEngine()) << path << "no local discovery needed";
}
return result;
}
result = false;
qCInfo(lcEngine()) << path << "no local discovery needed";
qCDebug(lcEngine()) << path << "no local discovery needed";
return result;
}

Expand All @@ -1300,12 +1300,12 @@ bool SyncEngine::shouldDiscoverLocally(const QString &path) const
++it;
if (it == _localDiscoveryPaths.end() || !it->startsWith(path)) {
result = false;
qCInfo(lcEngine()) << path << "no local discovery needed";
qCDebug(lcEngine()) << path << "no local discovery needed";
return result;
}
}

qCInfo(lcEngine()) << path << "no local discovery needed";
qCDebug(lcEngine()) << path << "no local discovery needed";
return result;
}

Expand Down
Loading