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/resourceaccess.h | |
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/resourceaccess.h')
-rw-r--r-- | common/resourceaccess.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/resourceaccess.h b/common/resourceaccess.h index 47b848e..5d66246 100644 --- a/common/resourceaccess.h +++ b/common/resourceaccess.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <flatbuffers/flatbuffers.h> | 30 | #include <flatbuffers/flatbuffers.h> |
31 | #include "notification.h" | 31 | #include "notification.h" |
32 | #include "log.h" | ||
32 | 33 | ||
33 | namespace Sink { | 34 | namespace Sink { |
34 | 35 | ||
@@ -93,6 +94,7 @@ protected: | |||
93 | class SINK_EXPORT ResourceAccess : public ResourceAccessInterface | 94 | class SINK_EXPORT ResourceAccess : public ResourceAccessInterface |
94 | { | 95 | { |
95 | Q_OBJECT | 96 | Q_OBJECT |
97 | SINK_DEBUG_AREA("communication") | ||
96 | public: | 98 | public: |
97 | typedef QSharedPointer<ResourceAccess> Ptr; | 99 | typedef QSharedPointer<ResourceAccess> Ptr; |
98 | 100 | ||
@@ -138,6 +140,7 @@ private: | |||
138 | 140 | ||
139 | class Private; | 141 | class Private; |
140 | Private *const d; | 142 | Private *const d; |
143 | // SINK_DEBUG_COMPONENT(d->resourceInstanceIdentifier) | ||
141 | }; | 144 | }; |
142 | 145 | ||
143 | /** | 146 | /** |
@@ -147,6 +150,7 @@ private: | |||
147 | */ | 150 | */ |
148 | class SINK_EXPORT ResourceAccessFactory | 151 | class SINK_EXPORT ResourceAccessFactory |
149 | { | 152 | { |
153 | SINK_DEBUG_AREA("ResourceAccessFactory") | ||
150 | public: | 154 | public: |
151 | static ResourceAccessFactory &instance(); | 155 | static ResourceAccessFactory &instance(); |
152 | Sink::ResourceAccess::Ptr getAccess(const QByteArray &instanceIdentifier, const QByteArray resourceType); | 156 | Sink::ResourceAccess::Ptr getAccess(const QByteArray &instanceIdentifier, const QByteArray resourceType); |