From 63db311d5a64b9942dc69e1b13b4570a548554c0 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 13 May 2017 15:10:07 +0900 Subject: 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). --- events/event.cpp | 5 ++--- events/receiptevent.cpp | 8 ++++---- events/roomaliasesevent.cpp | 4 ++-- events/roommemberevent.cpp | 3 +-- events/roommessageevent.cpp | 3 ++- events/typingevent.cpp | 6 +++--- events/unknownevent.cpp | 5 ++--- 7 files changed, 16 insertions(+), 18 deletions(-) (limited to 'events') 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 #include -#include -#include -#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 -#include 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 -#include 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 +#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 -#include 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 -#include 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 -#include +#include "logging.h" -#include "util.h" +#include using namespace QMatrixClient; -- cgit v1.2.3