diff --git a/src/app/appsettingsmanager.cpp b/src/app/appsettingsmanager.cpp index a9c2aee183774bbe3084c9f1fb853a51918a8978..c7330b3f53b77336bac76375e27e887f7f19bda6 100644 --- a/src/app/appsettingsmanager.cpp +++ b/src/app/appsettingsmanager.cpp @@ -20,6 +20,8 @@ #include "appsettingsmanager.h" +#include "global.h" + #include <QCoreApplication> #include <QLibraryInfo> @@ -101,7 +103,7 @@ AppSettingsManager::loadTranslations() installedTr_.clear(); QString locale_name = getLanguage(); - qDebug() << QString("Using locale: %1").arg(locale_name); + C_INFO << QString("Using locale: %1").arg(locale_name); QString locale_lang = locale_name.split('_')[0]; QTranslator* qtTranslator_lang = new QTranslator(qApp); diff --git a/src/app/connectivitymonitor.cpp b/src/app/connectivitymonitor.cpp index 6f2551bc0ec6028cbac8014dfd94a21d0c1b9350..c9024eb73cbaf467ea2aaf23e1a1c429b81fdcd8 100644 --- a/src/app/connectivitymonitor.cpp +++ b/src/app/connectivitymonitor.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "global.h" + #ifndef _WIN32 #include <glib.h> #include <gio/gio.h> @@ -171,10 +173,10 @@ static void logConnectionInfo(NMActiveConnection* connection) { if (connection) { - qDebug() << "primary network connection:" << nm_active_connection_get_uuid(connection) - << "default: " << (nm_active_connection_get_default(connection) ? "yes" : "no"); + C_INFO << "primary network connection:" << nm_active_connection_get_uuid(connection) + << "default: " << (nm_active_connection_get_default(connection) ? "yes" : "no"); } else { - qWarning() << "no primary network connection detected, check network settings"; + C_WARN << "no primary network connection detected, check network settings"; } } @@ -191,11 +193,10 @@ nmClientCallback(G_GNUC_UNUSED GObject* source_object, GAsyncResult* result, Con { GError* error = nullptr; if (auto nm_client = nm_client_new_finish(result, &error)) { - qDebug() << "NetworkManager client initialized, version: " - << nm_client_get_version(nm_client) - << ", daemon running:" << (nm_client_get_nm_running(nm_client) ? "yes" : "no") - << ", networking enabled:" - << (nm_client_networking_get_enabled(nm_client) ? "yes" : "no"); + C_INFO << "NetworkManager client initialized, version: " << nm_client_get_version(nm_client) + << ", daemon running:" << (nm_client_get_nm_running(nm_client) ? "yes" : "no") + << ", networking enabled:" + << (nm_client_networking_get_enabled(nm_client) ? "yes" : "no"); auto connection = nm_client_get_primary_connection(nm_client); logConnectionInfo(connection); @@ -205,7 +206,7 @@ nmClientCallback(G_GNUC_UNUSED GObject* source_object, GAsyncResult* result, Con cm); } else { - qWarning() << "error initializing NetworkManager client: " << error->message; + C_WARN << "error initializing NetworkManager client: " << error->message; g_clear_error(&error); } } @@ -222,7 +223,7 @@ ConnectivityMonitor::ConnectivityMonitor(QObject* parent) ConnectivityMonitor::~ConnectivityMonitor() { - qDebug() << "Destroying connectivity monitor"; + C_DBG << "Destroying connectivity monitor"; } bool diff --git a/src/app/currentcall.cpp b/src/app/currentcall.cpp index 4238abc30627484265ac5d8acb061436fa825c20..0c1bc48c051d32a83b8086c26017603c38c6acab 100644 --- a/src/app/currentcall.cpp +++ b/src/app/currentcall.cpp @@ -18,6 +18,7 @@ #include "currentcall.h" #include "callparticipantsmodel.h" +#include "global.h" #include <api/callparticipantsmodel.h> #include <api/devicemodel.h> @@ -348,7 +349,7 @@ CurrentCall::onCurrentAccountIdChanged() auto& accInfo = lrcInstance_->getCurrentAccountInfo(); set_isSIP(accInfo.profileInfo.type == profile::Type::SIP); } catch (const std::exception& e) { - qWarning() << "Can't update current call type" << e.what(); + C_DBG << "Can't update current call type" << e.what(); } connectModel(); diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index 89d5875ea5899a699a9e36fa90841e1c21eaa503..cd73bf28927c3f6001fb860b87b910833e98e5e0 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -162,6 +162,8 @@ MainApplication::MainApplication(int& argc, char** argv) "libclient.debug=false\n" "qt.*=false\n" "qml.debug=false\n" + "default.debug=false\n" + "client.debug=false\n" "\n"); // These can be set in the environment as well. // e.g. QT_LOGGING_RULES="*.debug=false;qml.debug=true" @@ -449,7 +451,7 @@ MainApplication::initQmlLayer() engine_->load(url); // Report the render interface used. - C_DBG << "Main window loaded using" << getRenderInterfaceString(); + C_INFO << "Main window loaded using" << getRenderInterfaceString(); } void diff --git a/src/app/screensaver.cpp b/src/app/screensaver.cpp index 379dfe1c57a83f01fec81f4ef7aea7e2294f8396..817fb5ec7c3083d81d7cbafce5cb9c9266413427 100644 --- a/src/app/screensaver.cpp +++ b/src/app/screensaver.cpp @@ -18,6 +18,8 @@ #include "screensaver.h" +#include "global.h" + #include <QDebug> ScreenSaver::ScreenSaver(QObject* parent) @@ -31,8 +33,7 @@ ScreenSaver::ScreenSaver(QObject* parent) } #else : QObject(parent) -{ -} +{} #endif #ifdef Q_OS_LINUX @@ -50,7 +51,7 @@ ScreenSaver::createInterface(void) services_[i], sessionBus_); if (screenSaverInterface_ && screenSaverInterface_->isValid()) { - qDebug() << "Screen saver dbus interface: " << services_[i]; + C_INFO << "Screen saver dbus interface: " << services_[i]; return true; } } diff --git a/src/app/systemtray.cpp b/src/app/systemtray.cpp index 223b10365479d2730938f9934dca78ae8bfc3753..bcb8ed947f53908f149f1ae23cbf7c8c359299d0 100644 --- a/src/app/systemtray.cpp +++ b/src/app/systemtray.cpp @@ -19,6 +19,7 @@ #include "systemtray.h" #include "appsettingsmanager.h" +#include "global.h" #ifdef USE_LIBNOTIFY #include <libnotify/notification.h> @@ -106,8 +107,8 @@ SystemTray::SystemTray(AppSettingsManager* settingsManager, QObject* parent) char* spec = nullptr; if (notify_get_server_info(&name, &vendor, &version, &spec)) { - qDebug() << QString("notify server name: %1, vendor: %2, version: %3, spec: %4") - .arg(name, vendor, version, spec); + C_INFO << QString("notify server name: %1, vendor: %2, version: %3, spec: %4") + .arg(name, vendor, version, spec); } // check notify server capabilities @@ -167,7 +168,7 @@ SystemTray::hideNotification(const QString& id) // Close GError* error = nullptr; if (!notify_notification_close(notification->second.nn.get(), &error)) { - qWarning("could not close notification: %s", error->message); + C_WARN << QString("could not close notification: %1").arg(error->message); g_clear_error(&error); return false; } @@ -235,7 +236,7 @@ SystemTray::showNotification(const QString& id, GError* error = nullptr; notify_notification_show(notification.get(), &error); if (error) { - qWarning("failed to show notification: %s", error->message); + C_WARN << QString("failed to show notification: %1").arg(error->message); g_clear_error(&error); } #else diff --git a/src/app/utils.cpp b/src/app/utils.cpp index b8b95afb4a59d138468364ba218870165960397a..371974f3f9325aad09f4d3655ef4edcb7a06cf38 100644 --- a/src/app/utils.cpp +++ b/src/app/utils.cpp @@ -24,6 +24,7 @@ #include "jamiavatartheme.h" #include "lrcinstance.h" +#include "global.h" #include <api/contact.h> @@ -488,7 +489,7 @@ Utils::conversationAvatar(LRCInstance* instance, painter.drawImage(avatar.rect(), peerAAvatar); painter.drawImage(avatar.rect(), peerBAvatar); } catch (const std::exception& e) { - qDebug() << Q_FUNC_INFO << e.what(); + C_DBG << e.what(); } return avatar; }