From cd206b3a720807301f1b1707698c4a405da89217 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Dec 2016 19:12:47 +0100 Subject: Debug output --- common/commandprocessor.cpp | 1 - common/pipeline.cpp | 2 +- common/storage/entitystore.cpp | 6 +++++- common/store.cpp | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp index 06ee142..20fcf3a 100644 --- a/common/commandprocessor.cpp +++ b/common/commandprocessor.cpp @@ -210,7 +210,6 @@ KAsync::Job CommandProcessor::processQueuedCommand(const QByteArray &dat } auto queuedCommand = Sink::GetQueuedCommand(data.constData()); const auto commandId = queuedCommand->commandId(); - SinkTrace() << "Dequeued Command: " << Sink::Commands::name(commandId); return processQueuedCommand(queuedCommand) .then( [this, commandId](const KAsync::Error &error, qint64 createdRevision) -> KAsync::Job { diff --git a/common/pipeline.cpp b/common/pipeline.cpp index b94e3f0..1620667 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -109,7 +109,7 @@ void Pipeline::commit() } const auto revision = d->entityStore.maxRevision(); const auto elapsed = d->transactionTime.elapsed(); - SinkLog() << "Committing revision: " << revision << ":" << d->transactionItemCount << " items in: " << Log::TraceTime(elapsed) << " " + SinkTrace() << "Committing revision: " << revision << ":" << d->transactionItemCount << " items in: " << Log::TraceTime(elapsed) << " " << (double)elapsed / (double)qMax(d->transactionItemCount, 1) << "[ms/item]"; d->entityStore.commitTransaction(); if (d->revisionChanged) { diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp index 1417861..7414f49 100644 --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp @@ -130,6 +130,8 @@ bool EntityStore::add(const QByteArray &type, const ApplicationDomain::Applicati auto entity = *ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation(entity_, entity_.availableProperties()); entity.setChangedProperties(entity.availableProperties().toSet()); + SinkTrace() << "New entity " << entity; + preprocess(entity); d->typeIndex(type).add(entity.identifier(), entity, d->transaction); @@ -205,7 +207,7 @@ bool EntityStore::modify(const QByteArray &type, const ApplicationDomain::Applic } newEntity.setChangedProperties(newEntity.availableProperties().toSet()); - SinkTrace() << "All properties: " << newEntity.availableProperties(); + SinkTrace() << "Modified entity " << newEntity; flatbuffers::FlatBufferBuilder fbb; d->resourceContext.adaptorFactory(type).createBuffer(newEntity, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); @@ -251,6 +253,8 @@ bool EntityStore::remove(const QByteArray &type, const QByteArray &uid, bool rep preprocess(current); d->typeIndex(type).remove(current.identifier(), current, d->transaction); + SinkTrace() << "Removed entity " << current; + const qint64 newRevision = DataStore::maxRevision(d->transaction) + 1; // Add metadata buffer diff --git a/common/store.cpp b/common/store.cpp index ef8a593..477b852 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -273,7 +273,7 @@ KAsync::Job Store::removeDataFromDisk(const QByteArray &identifier) static KAsync::Job synchronize(const QByteArray &resource, const Sink::SyncScope &scope) { - SinkTrace() << "Synchronizing " << resource; + SinkLog() << "Synchronizing " << resource; auto resourceAccess = ResourceAccessFactory::instance().getAccess(resource, ResourceConfig::getResourceType(resource)); return resourceAccess->synchronizeResource(scope) .addToContext(resourceAccess) @@ -295,7 +295,7 @@ KAsync::Job Store::synchronize(const Sink::Query &query) KAsync::Job Store::synchronize(const Sink::SyncScope &scope) { auto resources = getResources(scope.getResourceFilter()).keys(); - SinkTrace() << "Synchronize" << resources; + SinkLog() << "Synchronize" << resources; return KAsync::value(resources) .template each([scope](const QByteArray &resource) { return synchronize(resource, scope); @@ -363,6 +363,7 @@ DomainType Store::readOne(const Sink::Query &query) if (!list.isEmpty()) { return list.first(); } + SinkWarning() << "Tried to read value but no values are available."; return DomainType(); } -- cgit v1.2.3