From f17048d07157693e11247b25711d26ef064e689c Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sat, 3 Oct 2020 21:09:04 +0300 Subject: [PATCH] Enable verbose output in TDLibReceiver if DEBUG is defined This should have no effect on release build. --- src/tdlibreceiver.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tdlibreceiver.cpp b/src/tdlibreceiver.cpp index b091cee..f65a71f 100644 --- a/src/tdlibreceiver.cpp +++ b/src/tdlibreceiver.cpp @@ -20,6 +20,12 @@ #define LOG(x) qDebug() << "[TDLibReceiver]" << x +#ifdef DEBUG +# define VERBOSE(x) LOG(x) +#else +# define VERBOSE(x) +#endif + namespace { const QString ID("id"); const QString LIST("list"); @@ -110,7 +116,7 @@ void TDLibReceiver::receiverLoop() const char *result = td_json_client_receive(this->tdLibClient, WAIT_TIMEOUT); if (result) { QJsonDocument receivedJsonDocument = QJsonDocument::fromJson(QByteArray(result)); - // Too much information qDebug().noquote() << "[TDLibReceiver] Raw result: " << receivedJsonDocument.toJson(QJsonDocument::Indented); + VERBOSE("Raw result:" << receivedJsonDocument.toJson(QJsonDocument::Indented).constData()); processReceivedDocument(receivedJsonDocument); } }