misc: filter some noisy logs

Change-Id: I799e8f66e2008323817c73292f94e8c625564d67
diff --git a/src/app/appsettingsmanager.cpp b/src/app/appsettingsmanager.cpp
index a9c2aee..c7330b3 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 @@
     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 6f2551b..c9024eb 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 @@
 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 @@
 {
     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 @@
                          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()
 {
-    qDebug() << "Destroying connectivity monitor";
+    C_DBG << "Destroying connectivity monitor";
 }
 
 bool
diff --git a/src/app/currentcall.cpp b/src/app/currentcall.cpp
index 4238abc..0c1bc48 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 @@
         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 89d5875..cd73bf2 100644
--- a/src/app/mainapplication.cpp
+++ b/src/app/mainapplication.cpp
@@ -162,6 +162,8 @@
                                      "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 @@
     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 379dfe1..817fb5e 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 @@
 }
 #else
     : QObject(parent)
-{
-}
+{}
 #endif
 
 #ifdef Q_OS_LINUX
@@ -50,7 +51,7 @@
                                                    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 223b103..bcb8ed9 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 @@
     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 @@
     // 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 @@
     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 b8b95af..371974f 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 @@
         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;
 }