aboutsummaryrefslogtreecommitdiff
path: root/events/unknownevent.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-04-11 11:17:48 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-05-27 20:03:16 +0900
commit028ed5afc18209064002c9f6aa34e08a228d471f (patch)
tree19487214b57c445692c85b2a2b7eae8685022bec /events/unknownevent.cpp
parent5e6a0b961d1fc2162c5a7498f10bbd1a477f1ece (diff)
downloadlibquotient-028ed5afc18209064002c9f6aa34e08a228d471f.tar.gz
libquotient-028ed5afc18209064002c9f6aa34e08a228d471f.zip
Enhance logging
1. Introduce QDebug manipulators and formatJson manipulator in particular - this allows to accommodate some changes in Qt's debug printing behaviour between versions. 2. Show JSON for some questionable objects (UnknownEvents, events with no event_id etc.) 3. Log the list of typing users and the user id when getting an avatar.
Diffstat (limited to 'events/unknownevent.cpp')
-rw-r--r--events/unknownevent.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/events/unknownevent.cpp b/events/unknownevent.cpp
index 758d0ec8..90551409 100644
--- a/events/unknownevent.cpp
+++ b/events/unknownevent.cpp
@@ -19,6 +19,9 @@
#include "unknownevent.h"
#include <QtCore/QJsonDocument>
+#include <QtCore/QDebug>
+
+#include "../logging_util.h"
using namespace QMatrixClient;
@@ -56,5 +59,7 @@ UnknownEvent* UnknownEvent::fromJson(const QJsonObject& obj)
e->parseJson(obj);
e->d->type = obj.value("type").toString();
e->d->content = QString::fromUtf8(QJsonDocument(obj).toJson());
+ qDebug() << "UnknownEvent, JSON follows:";
+ qDebug() << formatJson << obj;
return e;
-} \ No newline at end of file
+}