summaryrefslogtreecommitdiffstats
path: root/common/storage_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r--common/storage_common.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp
index 10870d4..e534bc1 100644
--- a/common/storage_common.cpp
+++ b/common/storage_common.cpp
@@ -21,7 +21,7 @@
21 21
22#include "storage.h" 22#include "storage.h"
23 23
24#include <iostream> 24#include "log.h"
25 25
26namespace Akonadi2 26namespace Akonadi2
27{ 27{
@@ -31,9 +31,7 @@ static const int s_internalPrefixSize = strlen(s_internalPrefix);
31 31
32void errorHandler(const Storage::Error &error) 32void errorHandler(const Storage::Error &error)
33{ 33{
34 //TODO: allow this to be turned on / off globally 34 Warning() << "Database error in " << error.store << ", code " << error.code << ", message: " << error.message;
35 //TODO: log $SOMEWHERE $SOMEHOW rather than just spit to stderr
36 std::cout << "Read error in " << error.store.toStdString() << ", code " << error.code << ", message: " << error.message.toStdString() << std::endl;
37} 35}
38 36
39std::function<void(const Storage::Error &error)> Storage::basicErrorHandler() 37std::function<void(const Storage::Error &error)> Storage::basicErrorHandler()
@@ -67,7 +65,7 @@ qint64 Storage::maxRevision(const Akonadi2::Storage::Transaction &transaction)
67 return false; 65 return false;
68 }, [](const Error &error){ 66 }, [](const Error &error){
69 if (error.code != Akonadi2::Storage::NotFound) { 67 if (error.code != Akonadi2::Storage::NotFound) {
70 std::cout << "Coultn'd find the maximum revision" << std::endl; 68 Warning() << "Coultn'd find the maximum revision.";
71 } 69 }
72 }); 70 });
73 return r; 71 return r;
@@ -86,7 +84,7 @@ qint64 Storage::cleanedUpRevision(const Akonadi2::Storage::Transaction &transact
86 return false; 84 return false;
87 }, [](const Error &error){ 85 }, [](const Error &error){
88 if (error.code != Akonadi2::Storage::NotFound) { 86 if (error.code != Akonadi2::Storage::NotFound) {
89 std::cout << "Coultn'd find the maximum revision" << std::endl; 87 Warning() << "Coultn'd find the maximum revision.";
90 } 88 }
91 }); 89 });
92 return r; 90 return r;
@@ -99,7 +97,7 @@ QByteArray Storage::getUidFromRevision(const Akonadi2::Storage::Transaction &tra
99 uid = value; 97 uid = value;
100 return false; 98 return false;
101 }, [revision](const Error &error){ 99 }, [revision](const Error &error){
102 std::cout << "Coultn'd find uid for revision " << revision << std::endl; 100 Warning() << "Coultn'd find uid for revision " << revision;
103 }); 101 });
104 return uid; 102 return uid;
105} 103}
@@ -111,7 +109,7 @@ QByteArray Storage::getTypeFromRevision(const Akonadi2::Storage::Transaction &tr
111 type = value; 109 type = value;
112 return false; 110 return false;
113 }, [revision](const Error &error){ 111 }, [revision](const Error &error){
114 std::cout << "Coultn'd find type for revision " << revision << std::endl; 112 Warning() << "Coultn'd find type for revision " << revision;
115 }); 113 });
116 return type; 114 return type;
117} 115}