diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-13 15:10:07 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-13 15:10:07 +0900 |
commit | 63db311d5a64b9942dc69e1b13b4570a548554c0 (patch) | |
tree | b996e4fc6533b93677986ade4e99cc718c3893c2 /events | |
parent | cff6aaafeee5c5f7d337c6001694bda119d3cba9 (diff) | |
download | libquotient-63db311d5a64b9942dc69e1b13b4570a548554c0.tar.gz libquotient-63db311d5a64b9942dc69e1b13b4570a548554c0.zip |
Refactored logging enhancements
logging.h/logging.cpp is now a full-fledged pair for all things logging. Two more categories added, EPHEMERAL and SYNCJOB, that control logging for ephemeral events and SyncJob, respectively (in particular, switching off EPHEMERAL greatly reduces the logspam about moving read markers and how many users have read up to which event).
Diffstat (limited to 'events')
-rw-r--r-- | events/event.cpp | 5 | ||||
-rw-r--r-- | events/receiptevent.cpp | 8 | ||||
-rw-r--r-- | events/roomaliasesevent.cpp | 4 | ||||
-rw-r--r-- | events/roommemberevent.cpp | 3 | ||||
-rw-r--r-- | events/roommessageevent.cpp | 3 | ||||
-rw-r--r-- | events/typingevent.cpp | 6 | ||||
-rw-r--r-- | events/unknownevent.cpp | 5 |
7 files changed, 16 insertions, 18 deletions
diff --git a/events/event.cpp b/events/event.cpp index b3f75ca9..07649b02 100644 --- a/events/event.cpp +++ b/events/event.cpp @@ -20,10 +20,7 @@ #include <QtCore/QJsonArray> #include <QtCore/QJsonDocument> -#include <QtCore/QDateTime> -#include <QtCore/QDebug> -#include "util.h" #include "roommessageevent.h" #include "roomnameevent.h" #include "roomaliasesevent.h" @@ -33,6 +30,8 @@ #include "typingevent.h" #include "receiptevent.h" #include "unknownevent.h" +#include "logging.h" +#include "util.h" using namespace QMatrixClient; diff --git a/events/receiptevent.cpp b/events/receiptevent.cpp index 5d11a0dd..c163424f 100644 --- a/events/receiptevent.cpp +++ b/events/receiptevent.cpp @@ -34,10 +34,10 @@ Example of a Receipt Event: */ #include "receiptevent.h" -#include "util.h" + +#include "logging.h" #include <QtCore/QJsonArray> -#include <QtCore/QDebug> using namespace QMatrixClient; @@ -73,8 +73,8 @@ ReceiptEvent* ReceiptEvent::fromJson(const QJsonObject& obj) { if (eventIt.key().isEmpty()) { - qCWarning(EVENTS) << "ReceiptEvent has an empty event id, skipping"; - qCDebug(EVENTS) << "ReceiptEvent content follows:\n" << contents; + qCWarning(EPHEMERAL) << "ReceiptEvent has an empty event id, skipping"; + qCDebug(EPHEMERAL) << "ReceiptEvent content follows:\n" << contents; continue; } const QJsonObject reads = eventIt.value().toObject().value("m.read").toObject(); diff --git a/events/roomaliasesevent.cpp b/events/roomaliasesevent.cpp index e0dbdb38..ab414498 100644 --- a/events/roomaliasesevent.cpp +++ b/events/roomaliasesevent.cpp @@ -33,10 +33,10 @@ // } #include "roomaliasesevent.h" -#include "util.h" + +#include "logging.h" #include <QtCore/QJsonArray> -#include <QtCore/QDebug> using namespace QMatrixClient; diff --git a/events/roommemberevent.cpp b/events/roommemberevent.cpp index 0dafd303..51dbbbab 100644 --- a/events/roommemberevent.cpp +++ b/events/roommemberevent.cpp @@ -17,9 +17,8 @@ */ #include "roommemberevent.h" -#include "util.h" -#include <QtCore/QDebug> +#include "logging.h" using namespace QMatrixClient; diff --git a/events/roommessageevent.cpp b/events/roommessageevent.cpp index fd6de464..677bb79f 100644 --- a/events/roommessageevent.cpp +++ b/events/roommessageevent.cpp @@ -17,10 +17,11 @@ */ #include "roommessageevent.h" + +#include "logging.h" #include "util.h" #include <QtCore/QMimeDatabase> -#include <QtCore/QDebug> using namespace QMatrixClient; diff --git a/events/typingevent.cpp b/events/typingevent.cpp index 11c3a565..009059af 100644 --- a/events/typingevent.cpp +++ b/events/typingevent.cpp @@ -17,10 +17,10 @@ */ #include "typingevent.h" -#include "util.h" + +#include "logging.h" #include <QtCore/QJsonArray> -#include <QtCore/QDebug> using namespace QMatrixClient; @@ -55,6 +55,6 @@ TypingEvent* TypingEvent::fromJson(const QJsonObject& obj) { e->d->users << user.toString(); } - qCDebug(EVENTS) << "Typing:" << e->d->users; + qCDebug(EPHEMERAL) << "Typing:" << e->d->users; return e; } diff --git a/events/unknownevent.cpp b/events/unknownevent.cpp index b2947bf7..1670ff1d 100644 --- a/events/unknownevent.cpp +++ b/events/unknownevent.cpp @@ -18,10 +18,9 @@ #include "unknownevent.h" -#include <QtCore/QJsonDocument> -#include <QtCore/QDebug> +#include "logging.h" -#include "util.h" +#include <QtCore/QJsonDocument> using namespace QMatrixClient; |