From 6f3f86f9617486e1d30f263189fedafa1fedd62e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 14 Mar 2017 11:41:32 +0100 Subject: Debug output --- common/resourceaccess.cpp | 2 +- common/resourcecontrol.cpp | 4 ++-- common/store.cpp | 16 ++++++++-------- common/synchronizer.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 50845ac..4831c72 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp @@ -614,7 +614,7 @@ bool ResourceAccess::processMessageBuffer() [[clang::fallthrough]]; case Sink::Notification::Progress: { auto n = getNotification(buffer); - SinkTrace() << "Received notification: " << n.type; + SinkTrace() << "Received notification: Type:" << n.type << "Message: " << n.message << "Code: " << n.code; emit notification(n); } break; case Sink::Notification::RevisionUpdate: diff --git a/common/resourcecontrol.cpp b/common/resourcecontrol.cpp index 1f61a1c..70a3f7d 100644 --- a/common/resourcecontrol.cpp +++ b/common/resourcecontrol.cpp @@ -100,9 +100,9 @@ KAsync::Job ResourceControl::flush(Flush::FlushType type, const QByteArray auto notifier = QSharedPointer::create(resourceAccess); auto id = QUuid::createUuid().toByteArray(); return KAsync::start([=](KAsync::Future &future) { - SinkTrace() << "Waiting for notification notification " << id; + SinkTrace() << "Waiting for flush completion notification " << id; notifier->registerHandler([&future, id](const Notification ¬ification) { - SinkTrace() << "Received notification " << notification.type << notification.id; + SinkTrace() << "Received notification: " << notification.type << notification.id; if (notification.id == id) { SinkTrace() << "FlushComplete"; if (notification.code) { diff --git a/common/store.cpp b/common/store.cpp index 1c8620b..727f4cc 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -281,14 +281,14 @@ static KAsync::Job synchronize(const QByteArray &resource, const Sink::Syn auto resourceAccess = ResourceAccessFactory::instance().getAccess(resource, ResourceConfig::getResourceType(resource)); return resourceAccess->synchronizeResource(scope) .addToContext(resourceAccess) - .then([](const KAsync::Error &error) { - if (error) { - SinkWarning() << "Error during sync."; - return KAsync::error(error); - } - SinkTrace() << "synced."; - return KAsync::null(); - }); + .then([=](const KAsync::Error &error) { + if (error) { + SinkWarning() << "Error during sync."; + return KAsync::error(error); + } + SinkTrace() << "Synchronization of resource " << resource << " complete."; + return KAsync::null(); + }); } KAsync::Job Store::synchronize(const Sink::Query &query) diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index e722f57..c7c0af5 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp @@ -353,7 +353,7 @@ KAsync::Job Synchronizer::processRequest(const SyncRequest &request) Q_ASSERT(!request.requestId.isEmpty()); //FIXME it looks like this is emitted before the replay actually finishes if (request.flushType == Flush::FlushReplayQueue) { - SinkTraceCtx(mLogCtx) << "Emitting flush completion."; + SinkTraceCtx(mLogCtx) << "Emitting flush completion: " << request.requestId; Sink::Notification n; n.type = Sink::Notification::FlushCompletion; n.id = request.requestId; @@ -410,7 +410,7 @@ KAsync::Job Synchronizer::processSyncQueue() emit changesReplayed(); } if (error) { - SinkWarningCtx(mLogCtx) << "Error during sync: " << error.errorMessage; + SinkWarningCtx(mLogCtx) << "Error during sync: " << error; } //In case we got more requests meanwhile. return processSyncQueue(); -- cgit v1.2.3