summaryrefslogtreecommitdiffstats
path: root/common/specialpurposepreprocessor.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/specialpurposepreprocessor.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/specialpurposepreprocessor.cpp')
-rw-r--r--common/specialpurposepreprocessor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/specialpurposepreprocessor.cpp b/common/specialpurposepreprocessor.cpp
index 2892105..0985880 100644
--- a/common/specialpurposepreprocessor.cpp
+++ b/common/specialpurposepreprocessor.cpp
@@ -5,6 +5,8 @@
5 5
6using namespace Sink; 6using namespace Sink;
7 7
8SINK_DEBUG_AREA("SpecialPurposeProcessor")
9
8static QHash<QByteArray, QString> specialPurposeFolders() 10static QHash<QByteArray, QString> specialPurposeFolders()
9{ 11{
10 QHash<QByteArray, QString> hash; 12 QHash<QByteArray, QString> hash;
@@ -53,7 +55,7 @@ QByteArray SpecialPurposeProcessor::ensureFolder(Sink::Storage::Transaction &tra
53 return false; 55 return false;
54 }); 56 });
55 if (!mSpecialPurposeFolders.contains(specialPurpose)) { 57 if (!mSpecialPurposeFolders.contains(specialPurpose)) {
56 Trace() << "Failed to find a drafts folder, creating a new one"; 58 SinkTrace() << "Failed to find a drafts folder, creating a new one";
57 auto folder = ApplicationDomain::Folder::create(mResourceInstanceIdentifier); 59 auto folder = ApplicationDomain::Folder::create(mResourceInstanceIdentifier);
58 folder.setSpecialPurpose(QByteArrayList() << specialPurpose); 60 folder.setSpecialPurpose(QByteArrayList() << specialPurpose);
59 folder.setName(sSpecialPurposeFolders.value(specialPurpose)); 61 folder.setName(sSpecialPurposeFolders.value(specialPurpose));