diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-07 22:23:49 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-07 22:23:49 +0200 |
commit | da2b049e248c1ad7efeb53685158a205335e4e36 (patch) | |
tree | 1e7e5e940e9b760b2108081b1d2f3879cebdb0ff /common/facade.cpp | |
parent | 9bcb822963fc96c94dbe7dcc4134dcd2dac454ff (diff) | |
download | sink-da2b049e248c1ad7efeb53685158a205335e4e36.tar.gz sink-da2b049e248c1ad7efeb53685158a205335e4e36.zip |
A new debug system.
Instead of a single #define as debug area the new system allows for an
identifier for each debug message with the structure component.area.
The component is a dot separated identifier of the runtime component,
such as the process or the plugin.
The area is the code component, and can be as such defined at
compiletime.
The idea of this system is that it becomes possible to i.e. look at the
output of all messages in the query subsystem of a specific resource
(something that happens in the client process, but in the
resource-specific subcomponent).
The new macros are supposed to be less likely to clash with other names,
hence the new names.
Diffstat (limited to 'common/facade.cpp')
-rw-r--r-- | common/facade.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/common/facade.cpp b/common/facade.cpp index 2660300..72f7414 100644 --- a/common/facade.cpp +++ b/common/facade.cpp | |||
@@ -30,9 +30,6 @@ | |||
30 | 30 | ||
31 | using namespace Sink; | 31 | using namespace Sink; |
32 | 32 | ||
33 | #undef DEBUG_AREA | ||
34 | #define DEBUG_AREA "client.facade" | ||
35 | |||
36 | template <class DomainType> | 33 | template <class DomainType> |
37 | GenericFacade<DomainType>::GenericFacade( | 34 | GenericFacade<DomainType>::GenericFacade( |
38 | const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory, const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess) | 35 | const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory, const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess) |
@@ -59,7 +56,7 @@ template <class DomainType> | |||
59 | KAsync::Job<void> GenericFacade<DomainType>::create(const DomainType &domainObject) | 56 | KAsync::Job<void> GenericFacade<DomainType>::create(const DomainType &domainObject) |
60 | { | 57 | { |
61 | if (!mDomainTypeAdaptorFactory) { | 58 | if (!mDomainTypeAdaptorFactory) { |
62 | Warning() << "No domain type adaptor factory available"; | 59 | SinkWarning() << "No domain type adaptor factory available"; |
63 | return KAsync::error<void>(); | 60 | return KAsync::error<void>(); |
64 | } | 61 | } |
65 | flatbuffers::FlatBufferBuilder entityFbb; | 62 | flatbuffers::FlatBufferBuilder entityFbb; |
@@ -71,10 +68,10 @@ template <class DomainType> | |||
71 | KAsync::Job<void> GenericFacade<DomainType>::modify(const DomainType &domainObject) | 68 | KAsync::Job<void> GenericFacade<DomainType>::modify(const DomainType &domainObject) |
72 | { | 69 | { |
73 | if (!mDomainTypeAdaptorFactory) { | 70 | if (!mDomainTypeAdaptorFactory) { |
74 | Warning() << "No domain type adaptor factory available"; | 71 | SinkWarning() << "No domain type adaptor factory available"; |
75 | return KAsync::error<void>(); | 72 | return KAsync::error<void>(); |
76 | } | 73 | } |
77 | Trace() << "Modifying entity: " << domainObject.identifier() << domainObject.changedProperties(); | 74 | SinkTrace() << "Modifying entity: " << domainObject.identifier() << domainObject.changedProperties(); |
78 | flatbuffers::FlatBufferBuilder entityFbb; | 75 | flatbuffers::FlatBufferBuilder entityFbb; |
79 | mDomainTypeAdaptorFactory->createBuffer(domainObject, entityFbb); | 76 | mDomainTypeAdaptorFactory->createBuffer(domainObject, entityFbb); |
80 | return mResourceAccess->sendModifyCommand(domainObject.identifier(), domainObject.revision(), bufferTypeForDomainType(), QByteArrayList(), BufferUtils::extractBuffer(entityFbb), domainObject.changedProperties()); | 77 | return mResourceAccess->sendModifyCommand(domainObject.identifier(), domainObject.revision(), bufferTypeForDomainType(), QByteArrayList(), BufferUtils::extractBuffer(entityFbb), domainObject.changedProperties()); |