summaryrefslogtreecommitdiffstats
path: root/common/genericresource.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-04 16:56:09 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-04 16:56:09 +0100
commitafa7c80114a327d85ee6c99b9d3d811107d9e204 (patch)
treed7b518fb1313f52f76f843a28628ee9329770c29 /common/genericresource.cpp
parent639cdb811c721eedf20b9f81b8cdc626b85c5f24 (diff)
downloadsink-afa7c80114a327d85ee6c99b9d3d811107d9e204.tar.gz
sink-afa7c80114a327d85ee6c99b9d3d811107d9e204.zip
Introduced debug areas and prettified output.
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r--common/genericresource.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp
index 29cd8b1..b49ca94 100644
--- a/common/genericresource.cpp
+++ b/common/genericresource.cpp
@@ -22,6 +22,9 @@ static int sBatchSize = 100;
22 22
23using namespace Sink; 23using namespace Sink;
24 24
25#undef DEBUG_AREA
26#define DEBUG_AREA "resource.changereplay"
27
25/** 28/**
26 * Replays changes from the storage one by one. 29 * Replays changes from the storage one by one.
27 * 30 *
@@ -110,6 +113,9 @@ private:
110 ReplayFunction mReplayFunction; 113 ReplayFunction mReplayFunction;
111}; 114};
112 115
116#undef DEBUG_AREA
117#define DEBUG_AREA "resource.commandprocessor"
118
113/** 119/**
114 * Drives the pipeline using the output from all command queues 120 * Drives the pipeline using the output from all command queues
115 */ 121 */
@@ -286,6 +292,8 @@ private:
286 InspectionFunction mInspect; 292 InspectionFunction mInspect;
287}; 293};
288 294
295#undef DEBUG_AREA
296#define DEBUG_AREA "resource"
289 297
290GenericResource::GenericResource(const QByteArray &resourceInstanceIdentifier, const QSharedPointer<Pipeline> &pipeline) 298GenericResource::GenericResource(const QByteArray &resourceInstanceIdentifier, const QSharedPointer<Pipeline> &pipeline)
291 : Sink::Resource(), 299 : Sink::Resource(),
@@ -312,7 +320,7 @@ GenericResource::GenericResource(const QByteArray &resourceInstanceIdentifier, c
312 QVariant expectedValue; 320 QVariant expectedValue;
313 s >> expectedValue; 321 s >> expectedValue;
314 inspect(inspectionType, inspectionId, domainType, entityId, property, expectedValue).then<void>([=]() { 322 inspect(inspectionType, inspectionId, domainType, entityId, property, expectedValue).then<void>([=]() {
315 Log() << "Inspection was successful: " << inspectionType << inspectionId << entityId; 323 Log_area("resource.inspection") << "Inspection was successful: " << inspectionType << inspectionId << entityId;
316 Sink::Notification n; 324 Sink::Notification n;
317 n.type = Sink::Commands::NotificationType_Inspection; 325 n.type = Sink::Commands::NotificationType_Inspection;
318 n.id = inspectionId; 326 n.id = inspectionId;
@@ -384,7 +392,6 @@ KAsync::Job<void> GenericResource::replay(Sink::Storage &synchronizationStore, c
384 392
385void GenericResource::removeFromDisk(const QByteArray &instanceIdentifier) 393void GenericResource::removeFromDisk(const QByteArray &instanceIdentifier)
386{ 394{
387 Warning() << "Removing from generic resource";
388 Sink::Storage(Sink::storageLocation(), instanceIdentifier, Sink::Storage::ReadWrite).removeFromDisk(); 395 Sink::Storage(Sink::storageLocation(), instanceIdentifier, Sink::Storage::ReadWrite).removeFromDisk();
389 Sink::Storage(Sink::storageLocation(), instanceIdentifier + ".userqueue", Sink::Storage::ReadWrite).removeFromDisk(); 396 Sink::Storage(Sink::storageLocation(), instanceIdentifier + ".userqueue", Sink::Storage::ReadWrite).removeFromDisk();
390 Sink::Storage(Sink::storageLocation(), instanceIdentifier + ".synchronizerqueue", Sink::Storage::ReadWrite).removeFromDisk(); 397 Sink::Storage(Sink::storageLocation(), instanceIdentifier + ".synchronizerqueue", Sink::Storage::ReadWrite).removeFromDisk();