summaryrefslogtreecommitdiffstats
path: root/common/notification.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-29 13:10:35 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-29 13:10:35 +0200
commitbd3bed841cce2c462b36febbbdbccd243f21854e (patch)
treeef8116e9ae6c7f995b6bea28dfc1cfc7867bde4a /common/notification.cpp
parenta8ed7673fc970616f457a4dc11c0579ab50081c3 (diff)
downloadsink-bd3bed841cce2c462b36febbbdbccd243f21854e.tar.gz
sink-bd3bed841cce2c462b36febbbdbccd243f21854e.zip
Print notification type names
Diffstat (limited to 'common/notification.cpp')
-rw-r--r--common/notification.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/common/notification.cpp b/common/notification.cpp
index 806d04a..e688b6d 100644
--- a/common/notification.cpp
+++ b/common/notification.cpp
@@ -19,8 +19,37 @@
19 */ 19 */
20#include "notification.h" 20#include "notification.h"
21 21
22using namespace Sink;
23
24static QByteArray name(int type)
25{
26 switch (type) {
27 case Notification::Shutdown:
28 return "shutdown";
29 case Notification::Status:
30 return "status";
31 case Notification::Info:
32 return "info";
33 case Notification::Warning:
34 return "warning";
35 case Notification::Error:
36 return "error";
37 case Notification::Progress:
38 return "progress";
39 case Notification::Inspection:
40 return "inspection";
41 case Notification::RevisionUpdate:
42 return "revisionupdate";
43 case Notification::FlushCompletion:
44 return "flushcompletion";
45 }
46 return "Unknown:" + QByteArray::number(type);
47}
48
22QDebug operator<<(QDebug dbg, const Sink::Notification &n) 49QDebug operator<<(QDebug dbg, const Sink::Notification &n)
23{ 50{
24 dbg << "Notification(Type: " << n.type << "Id, : " << n.id << ", Code: " << n.code << ", Message: " << n.message << ", Entities: " << n.entities << ")"; 51 dbg << "Notification(Type: " << name(n.type) << "Id, : " << n.id << ", Code: ";
52 dbg << n.code;
53 dbg << ", Message: " << n.message << ", Entities: " << n.entities << ")";
25 return dbg.space(); 54 return dbg.space();
26} 55}