-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use QLoggingCategory #37
Comments
As far as I read QLoggingCategory is about different output categories for different stuff. |
Hello, sorry for the long reply. diff --git a/TelegramQt/CTelegramDispatcher.cpp b/TelegramQt/CTelegramDispatcher.cpp
index 011a710..13876ef 100644
--- a/TelegramQt/CTelegramDispatcher.cpp
+++ b/TelegramQt/CTelegramDispatcher.cpp
@@ -31,13 +31,15 @@ using namespace TelegramUtils;
#include <QTimer>
#include <QCryptographicHash>
-#include <QDebug>
+#include <QLoggingCategory>
#include <algorithm>
#ifdef DEVELOPER_BUILD
#include "TLTypesDebug.hpp"
#endif
+Q_LOGGING_CATEGORY(categoryDispatcher, "telegram-qt.dispatcher", QtWarningMsg)
+
static const QVector<Telegram::DcOption> s_builtInDcs = QVector<Telegram::DcOption>()
<< Telegram::DcOption(QLatin1String("149.154.175.50") , 443)
<< Telegram::DcOption(QLatin1String("149.154.167.51") , 443)
@@ -212,7 +214,7 @@ QVector<Telegram::Peer> CTelegramDispatcher::dialogs() const
void CTelegramDispatcher::addContacts(const QStringList &phoneNumbers, bool replace)
{
- qDebug() << "addContacts" << maskPhoneNumberList(phoneNumbers);
+ qCDebug(categoryDispatcher) << "addContacts" << maskPhoneNumberList(phoneNumbers);
if (activeConnection()) {
TLVector<TLInputContact> contactsVector;
for (int i = 0; i < phoneNumbers.count(); ++i) { So: one category per class. A developer build output lools like this:
and a release debug build output for the same operation is
May be the ifdefs will be replaced in some far future, but I have no better solution yet. |
No description provided.
The text was updated successfully, but these errors were encountered: