summaryrefslogtreecommitdiffstats
path: root/common/messagequeue.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-07 22:23:49 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-07 22:23:49 +0200
commitda2b049e248c1ad7efeb53685158a205335e4e36 (patch)
tree1e7e5e940e9b760b2108081b1d2f3879cebdb0ff /common/messagequeue.cpp
parent9bcb822963fc96c94dbe7dcc4134dcd2dac454ff (diff)
downloadsink-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/messagequeue.cpp')
-rw-r--r--common/messagequeue.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/messagequeue.cpp b/common/messagequeue.cpp
index b9f11f8..a6e44e3 100644
--- a/common/messagequeue.cpp
+++ b/common/messagequeue.cpp
@@ -3,6 +3,8 @@
3#include <QDebug> 3#include <QDebug>
4#include <log.h> 4#include <log.h>
5 5
6SINK_DEBUG_AREA("messagequeue")
7
6static KAsync::Job<void> waitForCompletion(QList<KAsync::Future<void>> &futures) 8static KAsync::Job<void> waitForCompletion(QList<KAsync::Future<void>> &futures)
7{ 9{
8 auto context = new QObject; 10 auto context = new QObject;
@@ -128,7 +130,7 @@ KAsync::Job<void> MessageQueue::dequeueBatch(int maxBatchSize, const std::functi
128 return false; 130 return false;
129 }, 131 },
130 [](const Sink::Storage::Error &error) { 132 [](const Sink::Storage::Error &error) {
131 ErrorMsg() << "Error while retrieving value" << error.message; 133 SinkError() << "Error while retrieving value" << error.message;
132 // errorHandler(Error(error.store, error.code, error.message)); 134 // errorHandler(Error(error.store, error.code, error.message));
133 }); 135 });
134 136
@@ -164,7 +166,7 @@ bool MessageQueue::isEmpty()
164 } 166 }
165 return true; 167 return true;
166 }, 168 },
167 [](const Sink::Storage::Error &error) { ErrorMsg() << "Error while checking if empty" << error.message; }); 169 [](const Sink::Storage::Error &error) { SinkError() << "Error while checking if empty" << error.message; });
168 } 170 }
169 return count == 0; 171 return count == 0;
170} 172}