diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-20 13:58:23 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-20 13:58:23 +0100 |
commit | d844c23b6fca4adf5978b3f9650bc55c796dd2e3 (patch) | |
tree | c3378c9fc37c51b0176cfa1831dd8b3997ef7ac6 /common/storage_common.cpp | |
parent | b1e5525be34850ef4d11cccbf23e118c93e93506 (diff) | |
download | sink-d844c23b6fca4adf5978b3f9650bc55c796dd2e3.tar.gz sink-d844c23b6fca4adf5978b3f9650bc55c796dd2e3.zip |
Use the logging mechanism we have.
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 14 |
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 | ||
26 | namespace Akonadi2 | 26 | namespace Akonadi2 |
27 | { | 27 | { |
@@ -31,9 +31,7 @@ static const int s_internalPrefixSize = strlen(s_internalPrefix); | |||
31 | 31 | ||
32 | void errorHandler(const Storage::Error &error) | 32 | void 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 | ||
39 | std::function<void(const Storage::Error &error)> Storage::basicErrorHandler() | 37 | std::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 | } |