modernize: Remove custom Quassel-specific log macros
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 14 Oct 2018 22:49:57 +0000 (00:49 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
The quInfo(), quWarning(), quError() macros were introduced a long
time ago to provide custom log message handling, such as logging to
file or syslog. Such features have been directly supported for the
standard Qt log macros for a while now, using a global message handler.
The only reason for Quassel's custom macros to still exist was the
lack of an info log level prior to Qt 5.5.

As we can now rely on Qt 5.5 to be available, replace the custom
macros by Qt ones, and remove LogMessage which is no longer needed.

23 files changed:
src/client/clientauthhandler.cpp
src/common/CMakeLists.txt
src/common/expressionmatch.cpp
src/common/logmessage.cpp [deleted file]
src/common/logmessage.h [deleted file]
src/common/posixsignalwatcher.cpp
src/common/quassel.cpp
src/common/windowssignalwatcher.cpp
src/core/abstractsqlstorage.cpp
src/core/cipher.cpp
src/core/core.cpp
src/core/coreauthhandler.cpp
src/core/corebasichandler.cpp
src/core/coresession.cpp
src/core/coresessioneventprocessor.cpp
src/core/identserver.cpp
src/core/ldapauthenticator.cpp
src/core/postgresqlstorage.cpp
src/core/sqlauthenticator.cpp
src/core/sqlitestorage.cpp
src/core/sslserver.cpp
src/main/monoapplication.cpp
src/qtui/qtuiapplication.cpp

index a5bf291..5048554 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "client.h"
 #include "clientsettings.h"
 
 #include "client.h"
 #include "clientsettings.h"
-#include "logmessage.h"
 #include "peerfactory.h"
 #include "util.h"
 
 #include "peerfactory.h"
 #include "util.h"
 
@@ -324,10 +323,10 @@ void ClientAuthHandler::onConnectionReady()
     const auto& coreFeatures = _peer->features();
     auto unsupported = coreFeatures.toStringList(false);
     if (!unsupported.isEmpty()) {
     const auto& coreFeatures = _peer->features();
     auto unsupported = coreFeatures.toStringList(false);
     if (!unsupported.isEmpty()) {
-        quInfo() << qPrintable(tr("Core does not support the following features: %1").arg(unsupported.join(", ")));
+        qInfo() << qPrintable(tr("Core does not support the following features: %1").arg(unsupported.join(", ")));
     }
     if (!coreFeatures.unknownFeatures().isEmpty()) {
     }
     if (!coreFeatures.unknownFeatures().isEmpty()) {
-        quInfo() << qPrintable(tr("Core supports unknown features: %1").arg(coreFeatures.unknownFeatures().join(", ")));
+        qInfo() << qPrintable(tr("Core supports unknown features: %1").arg(coreFeatures.unknownFeatures().join(", ")));
     }
 
     emit connectionReady();
     }
 
     emit connectionReady();
index e7d7264..351c40c 100644 (file)
@@ -27,7 +27,6 @@ target_sources(${TARGET} PRIVATE
     irclisthelper.cpp
     ircuser.cpp
     logger.cpp
     irclisthelper.cpp
     ircuser.cpp
     logger.cpp
-    logmessage.cpp
     message.cpp
     messageevent.cpp
     network.cpp
     message.cpp
     messageevent.cpp
     network.cpp
index 17d08a5..73856a3 100644 (file)
@@ -25,8 +25,6 @@
 #include <QString>
 #include <QStringList>
 
 #include <QString>
 #include <QStringList>
 
-#include "logmessage.h"
-
 ExpressionMatch::ExpressionMatch(const QString& expression, MatchMode mode, bool caseSensitive)
 {
     // Store the original parameters for later reference
 ExpressionMatch::ExpressionMatch(const QString& expression, MatchMode mode, bool caseSensitive)
 {
     // Store the original parameters for later reference
@@ -379,7 +377,7 @@ void ExpressionMatch::cacheRegEx()
         // level as ideally someone's not just going to leave a broken match rule around.  For
         // MatchRegEx, they probably need to fix their regex rule.  For the other modes, there's
         // probably a bug in the parsing routines (which should also be fixed).
         // level as ideally someone's not just going to leave a broken match rule around.  For
         // MatchRegEx, they probably need to fix their regex rule.  For the other modes, there's
         // probably a bug in the parsing routines (which should also be fixed).
-        quInfo() << "Could not parse expression match rule" << _sourceExpression << "(match mode:" << (int)_sourceMode
+        qInfo() << "Could not parse expression match rule" << _sourceExpression << "(match mode:" << (int)_sourceMode
                  << "), this rule will be ignored";
     }
 }
                  << "), this rule will be ignored";
     }
 }
diff --git a/src/common/logmessage.cpp b/src/common/logmessage.cpp
deleted file mode 100644 (file)
index 573e61f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2018 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include "logmessage.h"
-
-#include <QDateTime>
-#include <QFile>
-#include <QTextStream>
-
-#include "quassel.h"
-
-LogMessage::LogMessage(Logger::LogLevel level)
-    : _stream(&_buffer, QIODevice::WriteOnly)
-    , _logLevel(level)
-{}
-
-LogMessage::~LogMessage()
-{
-    Quassel::instance()->logger()->handleMessage(_logLevel, _buffer);
-}
-
-LogMessage& LogMessage::operator<<(const QStringList& t)
-{
-    _stream << t.join(" ") << " ";
-    return *this;
-}
-
-LogMessage& LogMessage::operator<<(bool t)
-{
-    _stream << (t ? "true" : "false") << " ";
-    return *this;
-}
diff --git a/src/common/logmessage.h b/src/common/logmessage.h
deleted file mode 100644 (file)
index b4795ad..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2018 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#pragma once
-
-#include "common-export.h"
-
-#include <QStringList>
-#include <QTextStream>
-
-#include "logger.h"
-#include "types.h"
-
-/**
- * Class encapsulating a single log message.
- *
- * Very similar in concept to qDebug() and friends.
- */
-class COMMON_EXPORT LogMessage
-{
-public:
-    LogMessage(Logger::LogLevel level);
-    ~LogMessage();
-
-    template<typename T>
-    LogMessage& operator<<(const T& value)
-    {
-        _stream << value << " ";
-        return *this;
-    }
-
-    LogMessage& operator<<(const QStringList& t);
-    LogMessage& operator<<(bool t);
-
-private:
-    QTextStream _stream;
-    QString _buffer;
-    Logger::LogLevel _logLevel;
-};
-
-// The only reason for LogMessage and the helpers below to exist is the fact that Qt versions
-// prior to 5.5 did not support the Info level.
-// Once we can rely on Qt 5.5, they will be removed and replaced by the native Qt functions.
-
-/**
- * Creates an info-level log message.
- *
- * @sa qInfo
- */
-class quInfo : public LogMessage
-{
-public:
-    quInfo()
-        : LogMessage(Logger::LogLevel::Info)
-    {}
-};
-
-/**
- * Creates a warning-level log message.
- *
- * @sa qWarning
- */
-class quWarning : public LogMessage
-{
-public:
-    quWarning()
-        : LogMessage(Logger::LogLevel::Warning)
-    {}
-};
-
-/**
- * Creates an error-level log message.
- *
- * @sa qCritical
- */
-class quError : public LogMessage
-{
-public:
-    quError()
-        : LogMessage(Logger::LogLevel::Error)
-    {}
-};
index eee3918..0b2bfc9 100644 (file)
@@ -32,8 +32,6 @@
 #include <QDebug>
 #include <QSocketNotifier>
 
 #include <QDebug>
 #include <QSocketNotifier>
 
-#include "logmessage.h"
-
 int PosixSignalWatcher::_sockpair[2];
 
 PosixSignalWatcher::PosixSignalWatcher(QObject* parent)
 int PosixSignalWatcher::_sockpair[2];
 
 PosixSignalWatcher::PosixSignalWatcher(QObject* parent)
@@ -88,7 +86,7 @@ void PosixSignalWatcher::onNotify(int sockfd)
     int signal;
     auto bytes = ::read(sockfd, &signal, sizeof(signal));
     Q_UNUSED(bytes)
     int signal;
     auto bytes = ::read(sockfd, &signal, sizeof(signal));
     Q_UNUSED(bytes)
-    quInfo() << "Caught signal" << signal;
+    qInfo() << "Caught signal" << signal;
 
     switch (signal) {
     case SIGHUP:
 
     switch (signal) {
     case SIGHUP:
index fdcd052..3268ffe 100644 (file)
@@ -37,7 +37,6 @@
 #include "bufferinfo.h"
 #include "identity.h"
 #include "logger.h"
 #include "bufferinfo.h"
 #include "identity.h"
 #include "logger.h"
-#include "logmessage.h"
 #include "message.h"
 #include "network.h"
 #include "peer.h"
 #include "message.h"
 #include "network.h"
 #include "peer.h"
@@ -99,7 +98,7 @@ void Quassel::quit()
     // Protect against multiple invocations (e.g. triggered by MainWin::closeEvent())
     if (!_quitting) {
         _quitting = true;
     // Protect against multiple invocations (e.g. triggered by MainWin::closeEvent())
     if (!_quitting) {
         _quitting = true;
-        quInfo() << "Quitting...";
+        qInfo() << "Quitting...";
         if (_quitHandlers.empty()) {
             QCoreApplication::quit();
         }
         if (_quitHandlers.empty()) {
             QCoreApplication::quit();
         }
@@ -291,9 +290,9 @@ void Quassel::handleSignal(AbstractSignalWatcher::Action action)
     case AbstractSignalWatcher::Action::Reload:
         // Most applications use this as the 'configuration reload' command, e.g. nginx uses it for graceful reloading of processes.
         if (!_reloadHandlers.empty()) {
     case AbstractSignalWatcher::Action::Reload:
         // Most applications use this as the 'configuration reload' command, e.g. nginx uses it for graceful reloading of processes.
         if (!_reloadHandlers.empty()) {
-            quInfo() << "Reloading configuration";
+            qInfo() << "Reloading configuration";
             if (reloadConfig()) {
             if (reloadConfig()) {
-                quInfo() << "Successfully reloaded configuration";
+                qInfo() << "Successfully reloaded configuration";
             }
         }
         break;
             }
         }
         break;
@@ -302,7 +301,7 @@ void Quassel::handleSignal(AbstractSignalWatcher::Action action)
             quit();
         }
         else {
             quit();
         }
         else {
-            quInfo() << "Already shutting down, ignoring signal";
+            qInfo() << "Already shutting down, ignoring signal";
         }
         break;
     case AbstractSignalWatcher::Action::HandleCrash:
         }
         break;
     case AbstractSignalWatcher::Action::HandleCrash:
index f31e038..c68bc8e 100644 (file)
@@ -25,8 +25,6 @@
 
 #include <QDebug>
 
 
 #include <QDebug>
 
-#include "logmessage.h"
-
 // This handler is called by Windows in a different thread when a console event happens
 // FIXME: When the console window is closed, the application is supposedly terminated as soon as
 //        this handler returns. We may want to block and wait for the main thread so set some
 // This handler is called by Windows in a different thread when a console event happens
 // FIXME: When the console window is closed, the application is supposedly terminated as soon as
 //        this handler returns. We may want to block and wait for the main thread so set some
@@ -66,7 +64,7 @@ WindowsSignalWatcher::WindowsSignalWatcher(QObject* parent)
 
 void WindowsSignalWatcher::signalHandler(int signal)
 {
 
 void WindowsSignalWatcher::signalHandler(int signal)
 {
-    quInfo() << "Caught signal" << signal;
+    qInfo() << "Caught signal" << signal;
 
     switch (signal) {
     case SIGINT:
 
     switch (signal) {
     case SIGINT:
index f87ac1d..e80eb2c 100644 (file)
@@ -26,7 +26,6 @@
 #include <QSqlField>
 #include <QSqlQuery>
 
 #include <QSqlField>
 #include <QSqlQuery>
 
-#include "logmessage.h"
 #include "quassel.h"
 
 int AbstractSqlStorage::_nextConnectionId = 0;
 #include "quassel.h"
 
 int AbstractSqlStorage::_nextConnectionId = 0;
@@ -99,12 +98,12 @@ void AbstractSqlStorage::addConnectionToPool()
 void AbstractSqlStorage::dbConnect(QSqlDatabase& db)
 {
     if (!db.open()) {
 void AbstractSqlStorage::dbConnect(QSqlDatabase& db)
 {
     if (!db.open()) {
-        quWarning() << "Unable to open database" << displayName() << "for thread" << QThread::currentThread();
-        quWarning() << "-" << db.lastError().text();
+        qWarning() << "Unable to open database" << displayName() << "for thread" << QThread::currentThread();
+        qWarning() << "-" << db.lastError().text();
     }
     else {
         if (!initDbSession(db)) {
     }
     else {
         if (!initDbSession(db)) {
-            quWarning() << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread();
+            qWarning() << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread();
             db.close();
         }
     }
             db.close();
         }
     }
@@ -131,7 +130,7 @@ Storage::State AbstractSqlStorage::init(const QVariantMap& settings, const QProc
     }
 
     if (installedSchemaVersion() < schemaVersion()) {
     }
 
     if (installedSchemaVersion() < schemaVersion()) {
-        quInfo() << qPrintable(tr("Installed database schema (version %1) is not up to date. Upgrading to "
+        qInfo() << qPrintable(tr("Installed database schema (version %1) is not up to date. Upgrading to "
                                   "version %2...  This may take a while for major upgrades.")
                                    .arg(installedSchemaVersion())
                                    .arg(schemaVersion()));
                                   "version %2...  This may take a while for major upgrades.")
                                    .arg(installedSchemaVersion())
                                    .arg(schemaVersion()));
@@ -144,10 +143,10 @@ Storage::State AbstractSqlStorage::init(const QVariantMap& settings, const QProc
         }
         // Add a message when migration succeeds to avoid confusing folks by implying the schema upgrade failed if
         // later functionality does not work.
         }
         // Add a message when migration succeeds to avoid confusing folks by implying the schema upgrade failed if
         // later functionality does not work.
-        quInfo() << qPrintable(tr("Installed database schema successfully upgraded to version %1.").arg(schemaVersion()));
+        qInfo() << qPrintable(tr("Installed database schema successfully upgraded to version %1.").arg(schemaVersion()));
     }
 
     }
 
-    quInfo() << qPrintable(displayName()) << "storage backend is ready. Schema version:" << installedSchemaVersion();
+    qInfo() << qPrintable(displayName()) << "storage backend is ready. Schema version:" << installedSchemaVersion();
     return IsReady;
 }
 
     return IsReady;
 }
 
index 2d9bff4..efbd88e 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "cipher.h"
 
 
 #include "cipher.h"
 
-#include "logmessage.h"
-
 Cipher::Cipher()
 {
     m_primeNum = QCA::BigInteger(
 Cipher::Cipher()
 {
     m_primeNum = QCA::BigInteger(
index a59d897..9f9e1c6 100644 (file)
@@ -28,7 +28,6 @@
 #include "coresession.h"
 #include "coresettings.h"
 #include "internalpeer.h"
 #include "coresession.h"
 #include "coresettings.h"
 #include "internalpeer.h"
-#include "logmessage.h"
 #include "network.h"
 #include "postgresqlstorage.h"
 #include "quassel.h"
 #include "network.h"
 #include "postgresqlstorage.h"
 #include "quassel.h"
@@ -185,7 +184,7 @@ void Core::init()
                 throw ExitException{EXIT_FAILURE, tr("Cannot write quasselcore configuration; probably a permission problem.")};
             }
 
                 throw ExitException{EXIT_FAILURE, tr("Cannot write quasselcore configuration; probably a permission problem.")};
             }
 
-            quInfo() << "Core is currently not configured! Please connect with a Quassel Client for basic setup.";
+            qInfo() << "Core is currently not configured! Please connect with a Quassel Client for basic setup.";
         }
     }
     else {
         }
     }
     else {
@@ -257,7 +256,7 @@ void Core::initAsync()
 
 void Core::shutdown()
 {
 
 void Core::shutdown()
 {
-    quInfo() << "Core shutting down...";
+    qInfo() << "Core shutting down...";
 
     saveState();
 
 
     saveState();
 
@@ -281,7 +280,7 @@ void Core::onSessionShutdown(SessionThread* session)
 {
     _sessions.take(_sessions.key(session))->deleteLater();
     if (_sessions.isEmpty()) {
 {
     _sessions.take(_sessions.key(session))->deleteLater();
     if (_sessions.isEmpty()) {
-        quInfo() << "Core shutdown complete!";
+        qInfo() << "Core shutdown complete!";
         emit shutdownComplete();
     }
 }
         emit shutdownComplete();
     }
 }
@@ -301,11 +300,11 @@ void Core::saveState()
 void Core::restoreState()
 {
     if (!_configured) {
 void Core::restoreState()
 {
     if (!_configured) {
-        quWarning() << qPrintable(tr("Cannot restore a state for an unconfigured core!"));
+        qWarning() << qPrintable(tr("Cannot restore a state for an unconfigured core!"));
         return;
     }
     if (_sessions.count()) {
         return;
     }
     if (_sessions.count()) {
-        quWarning() << qPrintable(tr("Calling restoreState() even though active sessions exist!"));
+        qWarning() << qPrintable(tr("Calling restoreState() even though active sessions exist!"));
         return;
     }
 
         return;
     }
 
@@ -313,7 +312,7 @@ void Core::restoreState()
     /* We don't check, since we are at the first version since switching to Git
     uint statever = s.coreState().toMap()["CoreStateVersion"].toUInt();
     if(statever < 1) {
     /* We don't check, since we are at the first version since switching to Git
     uint statever = s.coreState().toMap()["CoreStateVersion"].toUInt();
     if(statever < 1) {
-      quWarning() << qPrintable(tr("Core state too old, ignoring..."));
+      qWarning() << qPrintable(tr("Core state too old, ignoring..."));
       return;
     }
     */
       return;
     }
     */
@@ -322,7 +321,7 @@ void Core::restoreState()
     QVariantList activeSessions = instance()->_storage->getCoreState(activeSessionsFallback);
 
     if (activeSessions.count() > 0) {
     QVariantList activeSessions = instance()->_storage->getCoreState(activeSessionsFallback);
 
     if (activeSessions.count() > 0) {
-        quInfo() << "Restoring previous core state...";
+        qInfo() << "Restoring previous core state...";
         for (auto&& v : activeSessions) {
             UserId user = v.value<UserId>();
             sessionForUser(user, true);
         for (auto&& v : activeSessions) {
             UserId user = v.value<UserId>();
             sessionForUser(user, true);
@@ -360,7 +359,7 @@ QString Core::setupCore(const QString& adminUser,
             return tr("Could not setup storage!");
         }
 
             return tr("Could not setup storage!");
         }
 
-        quInfo() << "Selected authenticator:" << authenticator;
+        qInfo() << "Selected authenticator:" << authenticator;
         if (!(_configured = initAuthenticator(authenticator, authSetupData, {}, false, true))) {
             return tr("Could not setup authenticator!");
         }
         if (!(_configured = initAuthenticator(authenticator, authSetupData, {}, false, true))) {
             return tr("Could not setup authenticator!");
         }
@@ -376,7 +375,7 @@ QString Core::setupCore(const QString& adminUser,
     }
     saveAuthenticatorSettings(authenticator, authSetupData);
 
     }
     saveAuthenticatorSettings(authenticator, authSetupData);
 
-    quInfo() << qPrintable(tr("Creating admin user..."));
+    qInfo() << qPrintable(tr("Creating admin user..."));
     _storage->addUser(adminUser, adminPassword);
     cacheSysIdent();
     startListening();  // TODO check when we need this
     _storage->addUser(adminUser, adminPassword);
     cacheSysIdent();
     startListening();  // TODO check when we need this
@@ -430,7 +429,7 @@ bool Core::initStorage(
     const QString& backend, const QVariantMap& settings, const QProcessEnvironment& environment, bool loadFromEnvironment, bool setup)
 {
     if (backend.isEmpty()) {
     const QString& backend, const QVariantMap& settings, const QProcessEnvironment& environment, bool loadFromEnvironment, bool setup)
 {
     if (backend.isEmpty()) {
-        quWarning() << "No storage backend selected!";
+        qWarning() << "No storage backend selected!";
         return false;
     }
 
         return false;
     }
 
@@ -525,7 +524,7 @@ bool Core::initAuthenticator(
     const QString& backend, const QVariantMap& settings, const QProcessEnvironment& environment, bool loadFromEnvironment, bool setup)
 {
     if (backend.isEmpty()) {
     const QString& backend, const QVariantMap& settings, const QProcessEnvironment& environment, bool loadFromEnvironment, bool setup)
 {
     if (backend.isEmpty()) {
-        quWarning() << "No authenticator selected!";
+        qWarning() << "No authenticator selected!";
         return false;
     }
 
         return false;
     }
 
@@ -636,29 +635,27 @@ bool Core::startListening()
                 switch (addr.protocol()) {
                 case QAbstractSocket::IPv6Protocol:
                     if (_v6server.listen(addr, port)) {
                 switch (addr.protocol()) {
                 case QAbstractSocket::IPv6Protocol:
                     if (_v6server.listen(addr, port)) {
-                        quInfo() << qPrintable(tr("Listening for GUI clients on IPv6 %1 port %2 using protocol version %3")
-                                                   .arg(addr.toString())
-                                                   .arg(_v6server.serverPort())
-                                                   .arg(Quassel::buildInfo().protocolVersion));
+                        qInfo() << qPrintable(tr("Listening for GUI clients on IPv6 %1 port %2 using protocol version %3")
+                                              .arg(addr.toString())
+                                              .arg(_v6server.serverPort())
+                                              .arg(Quassel::buildInfo().protocolVersion));
                         success = true;
                     }
                     else
                         success = true;
                     }
                     else
-                        quWarning() << qPrintable(
-                            tr("Could not open IPv6 interface %1:%2: %3").arg(addr.toString()).arg(port).arg(_v6server.errorString()));
+                        qWarning() << qPrintable(tr("Could not open IPv6 interface %1:%2: %3").arg(addr.toString()).arg(port).arg(_v6server.errorString()));
                     break;
                 case QAbstractSocket::IPv4Protocol:
                     if (_server.listen(addr, port)) {
                     break;
                 case QAbstractSocket::IPv4Protocol:
                     if (_server.listen(addr, port)) {
-                        quInfo() << qPrintable(tr("Listening for GUI clients on IPv4 %1 port %2 using protocol version %3")
-                                                   .arg(addr.toString())
-                                                   .arg(_server.serverPort())
-                                                   .arg(Quassel::buildInfo().protocolVersion));
+                        qInfo() << qPrintable(tr("Listening for GUI clients on IPv4 %1 port %2 using protocol version %3")
+                                              .arg(addr.toString())
+                                              .arg(_server.serverPort())
+                                              .arg(Quassel::buildInfo().protocolVersion));
                         success = true;
                     }
                     else {
                         // if v6 succeeded on Any, the port will be already in use - don't display the error then
                         if (!success || _server.serverError() != QAbstractSocket::AddressInUseError)
                         success = true;
                     }
                     else {
                         // if v6 succeeded on Any, the port will be already in use - don't display the error then
                         if (!success || _server.serverError() != QAbstractSocket::AddressInUseError)
-                            quWarning() << qPrintable(
-                                tr("Could not open IPv4 interface %1:%2: %3").arg(addr.toString()).arg(port).arg(_server.errorString()));
+                            qWarning() << qPrintable(tr("Could not open IPv4 interface %1:%2: %3").arg(addr.toString()).arg(port).arg(_server.errorString()));
                     }
                     break;
                 default:
                     }
                     break;
                 default:
@@ -669,7 +666,7 @@ bool Core::startListening()
         }
     }
     if (!success)
         }
     }
     if (!success)
-        quError() << qPrintable(tr("Could not open any network interfaces to listen on!"));
+        qCritical() << qPrintable(tr("Could not open any network interfaces to listen on!"));
 
     if (_identServer) {
         _identServer->startListening();
 
     if (_identServer) {
         _identServer->startListening();
@@ -695,9 +692,9 @@ void Core::stopListening(const QString& reason)
     }
     if (wasListening) {
         if (reason.isEmpty())
     }
     if (wasListening) {
         if (reason.isEmpty())
-            quInfo() << "No longer listening for GUI clients.";
+            qInfo() << "No longer listening for GUI clients.";
         else
         else
-            quInfo() << qPrintable(reason);
+            qInfo() << qPrintable(reason);
     }
 }
 
     }
 }
 
@@ -715,7 +712,7 @@ void Core::incomingConnection()
         connect(handler, &AuthHandler::socketError, this, &Core::socketError);
         connect(handler, &CoreAuthHandler::handshakeComplete, this, &Core::setupClientSession);
 
         connect(handler, &AuthHandler::socketError, this, &Core::socketError);
         connect(handler, &CoreAuthHandler::handshakeComplete, this, &Core::setupClientSession);
 
-        quInfo() << qPrintable(tr("Client connected from")) << qPrintable(socket->peerAddress().toString());
+        qInfo() << qPrintable(tr("Client connected from")) << qPrintable(socket->peerAddress().toString());
 
         if (!_configured) {
             stopListening(tr("Closing server for basic setup."));
 
         if (!_configured) {
             stopListening(tr("Closing server for basic setup."));
@@ -729,7 +726,7 @@ void Core::clientDisconnected()
     auto* handler = qobject_cast<CoreAuthHandler*>(sender());
     Q_ASSERT(handler);
 
     auto* handler = qobject_cast<CoreAuthHandler*>(sender());
     Q_ASSERT(handler);
 
-    quInfo() << qPrintable(tr("Non-authed client disconnected:")) << qPrintable(handler->socket()->peerAddress().toString());
+    qInfo() << qPrintable(tr("Non-authed client disconnected:")) << qPrintable(handler->socket()->peerAddress().toString());
     _connectingClients.remove(handler);
     handler->deleteLater();
 
     _connectingClients.remove(handler);
     handler->deleteLater();
 
@@ -802,13 +799,13 @@ void Core::setupInternalClientSession(QPointer<InternalPeer> clientPeer)
         uid = _storage->internalUser();
     }
     else {
         uid = _storage->internalUser();
     }
     else {
-        quWarning() << "Core::setupInternalClientSession(): You're trying to run monolithic Quassel with an unusable Backend! Go fix it!";
+        qWarning() << "Core::setupInternalClientSession(): You're trying to run monolithic Quassel with an unusable Backend! Go fix it!";
         emit exitRequested(EXIT_FAILURE, tr("Cannot setup storage backend."));
         return;
     }
 
     if (!clientPeer) {
         emit exitRequested(EXIT_FAILURE, tr("Cannot setup storage backend."));
         return;
     }
 
     if (!clientPeer) {
-        quWarning() << "Client peer went away, not starting a session";
+        qWarning() << "Client peer went away, not starting a session";
         return;
     }
 
         return;
     }
 
@@ -831,7 +828,7 @@ SessionThread* Core::sessionForUser(UserId uid, bool restore)
 
 void Core::socketError(QAbstractSocket::SocketError err, const QString& errorString)
 {
 
 void Core::socketError(QAbstractSocket::SocketError err, const QString& errorString)
 {
-    quWarning() << QString("Socket error %1: %2").arg(err).arg(errorString);
+    qWarning() << QString("Socket error %1: %2").arg(err).arg(errorString);
 }
 
 QVariantList Core::backendInfo()
 }
 
 QVariantList Core::backendInfo()
@@ -892,8 +889,8 @@ bool Core::selectBackend(const QString& backend)
                        _registeredStorageBackends.end(),
                        std::back_inserter(backends),
                        [](const DeferredSharedPtr<Storage>& backend) { return backend->displayName(); });
                        _registeredStorageBackends.end(),
                        std::back_inserter(backends),
                        [](const DeferredSharedPtr<Storage>& backend) { return backend->displayName(); });
-        quWarning() << qPrintable(tr("Unsupported storage backend: %1").arg(backend));
-        quWarning() << qPrintable(tr("Supported backends are:")) << qPrintable(backends.join(", "));
+        qWarning() << qPrintable(tr("Unsupported storage backend: %1").arg(backend));
+        qWarning() << qPrintable(tr("Supported backends are:")) << qPrintable(backends.join(", "));
         return false;
     }
 
         return false;
     }
 
@@ -905,27 +902,27 @@ bool Core::selectBackend(const QString& backend)
         if (!saveBackendSettings(backend, settings)) {
             qCritical() << qPrintable(QString("Could not save backend settings, probably a permission problem."));
         }
         if (!saveBackendSettings(backend, settings)) {
             qCritical() << qPrintable(QString("Could not save backend settings, probably a permission problem."));
         }
-        quWarning() << qPrintable(tr("Switched storage backend to: %1").arg(backend));
-        quWarning() << qPrintable(tr("Backend already initialized. Skipping Migration..."));
+        qWarning() << qPrintable(tr("Switched storage backend to: %1").arg(backend));
+        qWarning() << qPrintable(tr("Backend already initialized. Skipping Migration..."));
         return true;
     case Storage::NotAvailable:
         qCritical() << qPrintable(tr("Storage backend is not available: %1").arg(backend));
         return false;
     case Storage::NeedsSetup:
         if (!storage->setup(settings)) {
         return true;
     case Storage::NotAvailable:
         qCritical() << qPrintable(tr("Storage backend is not available: %1").arg(backend));
         return false;
     case Storage::NeedsSetup:
         if (!storage->setup(settings)) {
-            quWarning() << qPrintable(tr("Unable to setup storage backend: %1").arg(backend));
+            qWarning() << qPrintable(tr("Unable to setup storage backend: %1").arg(backend));
             return false;
         }
 
         if (storage->init(settings) != Storage::IsReady) {
             return false;
         }
 
         if (storage->init(settings) != Storage::IsReady) {
-            quWarning() << qPrintable(tr("Unable to initialize storage backend: %1").arg(backend));
+            qWarning() << qPrintable(tr("Unable to initialize storage backend: %1").arg(backend));
             return false;
         }
 
         if (!saveBackendSettings(backend, settings)) {
             qCritical() << qPrintable(QString("Could not save backend settings, probably a permission problem."));
         }
             return false;
         }
 
         if (!saveBackendSettings(backend, settings)) {
             qCritical() << qPrintable(QString("Could not save backend settings, probably a permission problem."));
         }
-        quWarning() << qPrintable(tr("Switched storage backend to: %1").arg(backend));
+        qWarning() << qPrintable(tr("Switched storage backend to: %1").arg(backend));
         break;
     }
 
         break;
     }
 
@@ -945,19 +942,19 @@ bool Core::selectBackend(const QString& backend)
             }
             return true;
         }
             }
             return true;
         }
-        quWarning() << qPrintable(tr("Unable to migrate storage backend! (No migration writer for %1)").arg(backend));
+        qWarning() << qPrintable(tr("Unable to migrate storage backend! (No migration writer for %1)").arg(backend));
         return false;
     }
 
     // inform the user why we cannot merge
     if (!_storage) {
         return false;
     }
 
     // inform the user why we cannot merge
     if (!_storage) {
-        quWarning() << qPrintable(tr("No currently active storage backend. Skipping migration..."));
+        qWarning() << qPrintable(tr("No currently active storage backend. Skipping migration..."));
     }
     else if (!reader) {
     }
     else if (!reader) {
-        quWarning() << qPrintable(tr("Currently active storage backend does not support migration: %1").arg(_storage->displayName()));
+        qWarning() << qPrintable(tr("Currently active storage backend does not support migration: %1").arg(_storage->displayName()));
     }
     if (writer) {
     }
     if (writer) {
-        quWarning() << qPrintable(tr("New storage backend does not support migration: %1").arg(backend));
+        qWarning() << qPrintable(tr("New storage backend does not support migration: %1").arg(backend));
     }
 
     // so we were unable to merge, but let's create a user \o/
     }
 
     // so we were unable to merge, but let's create a user \o/
@@ -979,8 +976,8 @@ bool Core::selectAuthenticator(const QString& backend)
                        _registeredAuthenticators.end(),
                        std::back_inserter(authenticators),
                        [](const DeferredSharedPtr<Authenticator>& authenticator) { return authenticator->displayName(); });
                        _registeredAuthenticators.end(),
                        std::back_inserter(authenticators),
                        [](const DeferredSharedPtr<Authenticator>& authenticator) { return authenticator->displayName(); });
-        quWarning() << qPrintable(tr("Unsupported authenticator: %1").arg(backend));
-        quWarning() << qPrintable(tr("Supported authenticators are:")) << qPrintable(authenticators.join(", "));
+        qWarning() << qPrintable(tr("Unsupported authenticator: %1").arg(backend));
+        qWarning() << qPrintable(tr("Supported authenticators are:")) << qPrintable(authenticators.join(", "));
         return false;
     }
 
         return false;
     }
 
@@ -990,24 +987,24 @@ bool Core::selectAuthenticator(const QString& backend)
     switch (state) {
     case Authenticator::IsReady:
         saveAuthenticatorSettings(backend, settings);
     switch (state) {
     case Authenticator::IsReady:
         saveAuthenticatorSettings(backend, settings);
-        quWarning() << qPrintable(tr("Switched authenticator to: %1").arg(backend));
+        qWarning() << qPrintable(tr("Switched authenticator to: %1").arg(backend));
         return true;
     case Authenticator::NotAvailable:
         qCritical() << qPrintable(tr("Authenticator is not available: %1").arg(backend));
         return false;
     case Authenticator::NeedsSetup:
         if (!auther->setup(settings)) {
         return true;
     case Authenticator::NotAvailable:
         qCritical() << qPrintable(tr("Authenticator is not available: %1").arg(backend));
         return false;
     case Authenticator::NeedsSetup:
         if (!auther->setup(settings)) {
-            quWarning() << qPrintable(tr("Unable to setup authenticator: %1").arg(backend));
+            qWarning() << qPrintable(tr("Unable to setup authenticator: %1").arg(backend));
             return false;
         }
 
         if (auther->init(settings) != Authenticator::IsReady) {
             return false;
         }
 
         if (auther->init(settings) != Authenticator::IsReady) {
-            quWarning() << qPrintable(tr("Unable to initialize authenticator: %1").arg(backend));
+            qWarning() << qPrintable(tr("Unable to initialize authenticator: %1").arg(backend));
             return false;
         }
 
         saveAuthenticatorSettings(backend, settings);
             return false;
         }
 
         saveAuthenticatorSettings(backend, settings);
-        quWarning() << qPrintable(tr("Switched authenticator to: %1").arg(backend));
+        qWarning() << qPrintable(tr("Switched authenticator to: %1").arg(backend));
     }
 
     _authenticator = std::move(auther);
     }
 
     _authenticator = std::move(auther);
@@ -1035,11 +1032,11 @@ bool Core::createUser()
     enableStdInEcho();
 
     if (password != password2) {
     enableStdInEcho();
 
     if (password != password2) {
-        quWarning() << "Passwords don't match!";
+        qWarning() << "Passwords don't match!";
         return false;
     }
     if (password.isEmpty()) {
         return false;
     }
     if (password.isEmpty()) {
-        quWarning() << "Password is empty!";
+        qWarning() << "Password is empty!";
         return false;
     }
 
         return false;
     }
 
@@ -1048,7 +1045,7 @@ bool Core::createUser()
         return true;
     }
     else {
         return true;
     }
     else {
-        quWarning() << "Unable to add user:" << qPrintable(username);
+        qWarning() << "Unable to add user:" << qPrintable(username);
         return false;
     }
 }
         return false;
     }
 }
@@ -1082,11 +1079,11 @@ bool Core::changeUserPass(const QString& username)
     enableStdInEcho();
 
     if (password != password2) {
     enableStdInEcho();
 
     if (password != password2) {
-        quWarning() << "Passwords don't match!";
+        qWarning() << "Passwords don't match!";
         return false;
     }
     if (password.isEmpty()) {
         return false;
     }
     if (password.isEmpty()) {
-        quWarning() << "Password is empty!";
+        qWarning() << "Password is empty!";
         return false;
     }
 
         return false;
     }
 
@@ -1095,7 +1092,7 @@ bool Core::changeUserPass(const QString& username)
         return true;
     }
     else {
         return true;
     }
     else {
-        quWarning() << "Failed to change password!";
+        qWarning() << "Failed to change password!";
         return false;
     }
 }
         return false;
     }
 }
index d559e44..3514ecd 100644 (file)
@@ -25,7 +25,6 @@
 #endif
 
 #include "core.h"
 #endif
 
 #include "core.h"
-#include "logmessage.h"
 
 using namespace Protocol;
 
 
 using namespace Protocol;
 
@@ -167,7 +166,7 @@ void CoreAuthHandler::handle(const RegisterClient& msg)
         useSsl = _connectionFeatures & Protocol::Encryption;
 
     if (Quassel::isOptionSet("require-ssl") && !useSsl && !_peer->isLocal()) {
         useSsl = _connectionFeatures & Protocol::Encryption;
 
     if (Quassel::isOptionSet("require-ssl") && !useSsl && !_peer->isLocal()) {
-        quInfo() << qPrintable(tr("SSL required but non-SSL connection attempt from %1").arg(socket()->peerAddress().toString()));
+        qInfo() << qPrintable(tr("SSL required but non-SSL connection attempt from %1").arg(socket()->peerAddress().toString()));
         _peer->dispatch(ClientDenied(tr("<b>SSL is required!</b><br>You need to use SSL in order to connect to this core.")));
         _peer->close();
         return;
         _peer->dispatch(ClientDenied(tr("<b>SSL is required!</b><br>You need to use SSL in order to connect to this core.")));
         _peer->close();
         return;
@@ -204,7 +203,7 @@ void CoreAuthHandler::handle(const SetupData& msg)
     // The default parameter to authenticator is Database.
     // Maybe this should be hardcoded elsewhere, i.e. as a define.
     QString authenticator = msg.authenticator;
     // The default parameter to authenticator is Database.
     // Maybe this should be hardcoded elsewhere, i.e. as a define.
     QString authenticator = msg.authenticator;
-    quInfo() << "[" << authenticator << "]";
+    qInfo() << "[" << authenticator << "]";
     if (authenticator.trimmed().isEmpty()) {
         authenticator = QString("Database");
     }
     if (authenticator.trimmed().isEmpty()) {
         authenticator = QString("Database");
     }
@@ -237,27 +236,27 @@ void CoreAuthHandler::handle(const Login& msg)
     }
 
     if (uid == 0) {
     }
 
     if (uid == 0) {
-        quInfo() << qPrintable(tr("Invalid login attempt from %1 as \"%2\"").arg(socket()->peerAddress().toString(), msg.user));
+        qInfo() << qPrintable(tr("Invalid login attempt from %1 as \"%2\"").arg(socket()->peerAddress().toString(), msg.user));
         _peer->dispatch(LoginFailed(tr(
             "<b>Invalid username or password!</b><br>The username/password combination you supplied could not be found in the database.")));
         return;
     }
     _peer->dispatch(LoginSuccess());
 
         _peer->dispatch(LoginFailed(tr(
             "<b>Invalid username or password!</b><br>The username/password combination you supplied could not be found in the database.")));
         return;
     }
     _peer->dispatch(LoginSuccess());
 
-    quInfo() << qPrintable(tr("Client %1 initialized and authenticated successfully as \"%2\" (UserId: %3).")
-                               .arg(socket()->peerAddress().toString(), msg.user, QString::number(uid.toInt())));
+    qInfo() << qPrintable(tr("Client %1 initialized and authenticated successfully as \"%2\" (UserId: %3).")
+                          .arg(socket()->peerAddress().toString(), msg.user, QString::number(uid.toInt())));
 
     const auto& clientFeatures = _peer->features();
     auto unsupported = clientFeatures.toStringList(false);
     if (!unsupported.isEmpty()) {
         if (unsupported.contains("NoFeatures"))
 
     const auto& clientFeatures = _peer->features();
     auto unsupported = clientFeatures.toStringList(false);
     if (!unsupported.isEmpty()) {
         if (unsupported.contains("NoFeatures"))
-            quInfo() << qPrintable(tr("Client does not support extended features."));
+            qInfo() << qPrintable(tr("Client does not support extended features."));
         else
         else
-            quInfo() << qPrintable(tr("Client does not support the following features: %1").arg(unsupported.join(", ")));
+            qInfo() << qPrintable(tr("Client does not support the following features: %1").arg(unsupported.join(", ")));
     }
 
     if (!clientFeatures.unknownFeatures().isEmpty()) {
     }
 
     if (!clientFeatures.unknownFeatures().isEmpty()) {
-        quInfo() << qPrintable(tr("Client supports unknown features: %1").arg(clientFeatures.unknownFeatures().join(", ")));
+        qInfo() << qPrintable(tr("Client supports unknown features: %1").arg(clientFeatures.unknownFeatures().join(", ")));
     }
 
     disconnect(socket(), nullptr, this, nullptr);
     }
 
     disconnect(socket(), nullptr, this, nullptr);
index 38b510e..aa4c442 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "corebasichandler.h"
 
 
 #include "corebasichandler.h"
 
-#include "logmessage.h"
 #include "util.h"
 
 CoreBasicHandler::CoreBasicHandler(CoreNetwork* parent)
 #include "util.h"
 
 CoreBasicHandler::CoreBasicHandler(CoreNetwork* parent)
index b5de50e..3bab9d9 100644 (file)
@@ -44,7 +44,6 @@
 #include "ircchannel.h"
 #include "ircparser.h"
 #include "ircuser.h"
 #include "ircchannel.h"
 #include "ircparser.h"
 #include "ircuser.h"
-#include "logmessage.h"
 #include "messageevent.h"
 #include "remotepeer.h"
 #include "storage.h"
 #include "messageevent.h"
 #include "remotepeer.h"
 #include "storage.h"
@@ -272,7 +271,7 @@ void CoreSession::removeClient(Peer* peer)
 {
     auto* p = qobject_cast<RemotePeer*>(peer);
     if (p)
 {
     auto* p = qobject_cast<RemotePeer*>(peer);
     if (p)
-        quInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
+        qInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
     _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
 }
 
     _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
 }
 
index df4a409..f9f54f3 100644 (file)
@@ -28,7 +28,6 @@
 #include "ctcpevent.h"
 #include "ircevent.h"
 #include "ircuser.h"
 #include "ctcpevent.h"
 #include "ircevent.h"
 #include "ircuser.h"
-#include "logmessage.h"
 #include "messageevent.h"
 #include "netsplit.h"
 #include "quassel.h"
 #include "messageevent.h"
 #include "netsplit.h"
 #include "quassel.h"
@@ -1548,7 +1547,7 @@ void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent* e)
 {
     // DCC support is unfinished, experimental and potentially dangerous, so make it opt-in
     if (!Quassel::isOptionSet("enable-experimental-dcc")) {
 {
     // DCC support is unfinished, experimental and potentially dangerous, so make it opt-in
     if (!Quassel::isOptionSet("enable-experimental-dcc")) {
-        quInfo() << "DCC disabled, start core with --enable-experimental-dcc if you really want to try it out";
+        qInfo() << "DCC disabled, start core with --enable-experimental-dcc if you really want to try it out";
         return;
     }
 
         return;
     }
 
index bd81e16..5cbb188 100644 (file)
@@ -23,7 +23,6 @@
 #include <limits>
 
 #include "corenetwork.h"
 #include <limits>
 
 #include "corenetwork.h"
-#include "logmessage.h"
 
 IdentServer::IdentServer(QObject* parent)
     : QObject(parent)
 
 IdentServer::IdentServer(QObject* parent)
     : QObject(parent)
@@ -38,19 +37,19 @@ bool IdentServer::startListening()
 
     bool success = false;
     if (_v6server.listen(QHostAddress("::1"), port)) {
 
     bool success = false;
     if (_v6server.listen(QHostAddress("::1"), port)) {
-        quInfo() << qPrintable(tr("Listening for identd clients on IPv6 %1 port %2").arg("::1").arg(_v6server.serverPort()));
+        qInfo() << qPrintable(tr("Listening for identd clients on IPv6 %1 port %2").arg("::1").arg(_v6server.serverPort()));
 
         success = true;
     }
 
     if (_server.listen(QHostAddress("127.0.0.1"), port)) {
 
         success = true;
     }
 
     if (_server.listen(QHostAddress("127.0.0.1"), port)) {
-        quInfo() << qPrintable(tr("Listening for identd clients on IPv4 %1 port %2").arg("127.0.0.1").arg(_server.serverPort()));
+        qInfo() << qPrintable(tr("Listening for identd clients on IPv4 %1 port %2").arg("127.0.0.1").arg(_server.serverPort()));
 
         success = true;
     }
 
     if (!success) {
 
         success = true;
     }
 
     if (!success) {
-        quError() << qPrintable(tr("Identd could not open any network interfaces to listen on! No identd functionality will be available"));
+        qWarning() << qPrintable(tr("Identd could not open any network interfaces to listen on! No identd functionality will be available"));
     }
 
     return success;
     }
 
     return success;
@@ -71,9 +70,9 @@ void IdentServer::stopListening(const QString& msg)
 
     if (wasListening) {
         if (msg.isEmpty())
 
     if (wasListening) {
         if (msg.isEmpty())
-            quInfo() << "No longer listening for identd clients.";
+            qInfo() << "No longer listening for identd clients.";
         else
         else
-            quInfo() << qPrintable(msg);
+            qInfo() << qPrintable(msg);
     }
 }
 
     }
 }
 
index 31221fd..e7dc3c0 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "ldapauthenticator.h"
 
 
 #include "ldapauthenticator.h"
 
-#include "logmessage.h"
 #include "network.h"
 #include "quassel.h"
 
 #include "network.h"
 #include "quassel.h"
 
@@ -152,11 +151,11 @@ Authenticator::State LdapAuthenticator::init(const QVariantMap& settings, const
 
     bool status = ldapConnect();
     if (!status) {
 
     bool status = ldapConnect();
     if (!status) {
-        quInfo() << qPrintable(backendId()) << "authenticator cannot connect.";
+        qInfo() << qPrintable(backendId()) << "authenticator cannot connect.";
         return NotAvailable;
     }
 
         return NotAvailable;
     }
 
-    quInfo() << qPrintable(backendId()) << "authenticator is ready.";
+    qInfo() << qPrintable(backendId()) << "authenticator is ready.";
     return IsReady;
 }
 
     return IsReady;
 }
 
@@ -177,7 +176,7 @@ bool LdapAuthenticator::ldapConnect()
     serverURIArray = serverURI.toLocal8Bit();
     res = ldap_initialize(&_connection, serverURIArray);
 
     serverURIArray = serverURI.toLocal8Bit();
     res = ldap_initialize(&_connection, serverURIArray);
 
-    quInfo() << "LDAP: Connecting to" << serverURI;
+    qInfo() << "LDAP: Connecting to" << serverURI;
 
     if (res != LDAP_SUCCESS) {
         qWarning() << "Could not connect to LDAP server:" << ldap_err2string(res);
 
     if (res != LDAP_SUCCESS) {
         qWarning() << "Could not connect to LDAP server:" << ldap_err2string(res);
index 200fd14..8b12396 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <QtSql>
 
 
 #include <QtSql>
 
-#include "logmessage.h"
 #include "network.h"
 #include "quassel.h"
 
 #include "network.h"
 #include "quassel.h"
 
@@ -46,7 +45,7 @@ std::unique_ptr<AbstractSqlMigrationWriter> PostgreSqlStorage::createMigrationWr
 bool PostgreSqlStorage::isAvailable() const
 {
     if (!QSqlDatabase::isDriverAvailable("QPSQL")) {
 bool PostgreSqlStorage::isAvailable() const
 {
     if (!QSqlDatabase::isDriverAvailable("QPSQL")) {
-        quWarning() << qPrintable(tr("PostgreSQL driver plugin not available for Qt. Installed drivers:"))
+        qWarning() << qPrintable(tr("PostgreSQL driver plugin not available for Qt. Installed drivers:"))
                     << qPrintable(QSqlDatabase::drivers().join(", "));
         return false;
     }
                     << qPrintable(QSqlDatabase::drivers().join(", "));
         return false;
     }
@@ -92,7 +91,7 @@ bool PostgreSqlStorage::initDbSession(QSqlDatabase& db)
         // as this is the expected behavior.
         // If it is a newer version, switch to legacy mode.
 
         // as this is the expected behavior.
         // If it is a newer version, switch to legacy mode.
 
-        quWarning() << "Switching Postgres to legacy mode. (set standard conforming strings to off)";
+        qWarning() << "Switching Postgres to legacy mode. (set standard conforming strings to off)";
         // If the following calls fail, it is a legacy DB anyways, so it doesn't matter
         // and no need to check the outcome.
         db.exec("set standard_conforming_strings = off");
         // If the following calls fail, it is a legacy DB anyways, so it doesn't matter
         // and no need to check the outcome.
         db.exec("set standard_conforming_strings = off");
@@ -106,14 +105,14 @@ bool PostgreSqlStorage::initDbSession(QSqlDatabase& db)
             if (query.lastError().isValid()) {
                 // We cannot enable standard conforming strings...
                 // since Quassel does no escaping by itself, this would yield a major vulnerability.
             if (query.lastError().isValid()) {
                 // We cannot enable standard conforming strings...
                 // since Quassel does no escaping by itself, this would yield a major vulnerability.
-                quError() << "Failed to enable standard_conforming_strings for the Postgres db!";
+                qCritical() << "Failed to enable standard_conforming_strings for the Postgres db!";
                 return false;
             }
         }
         break;
     default:
         // The slash got replaced with 0 or more than 2 slashes! o_O
                 return false;
             }
         }
         break;
     default:
         // The slash got replaced with 0 or more than 2 slashes! o_O
-        quError() << "Your version of Qt does something _VERY_ strange to slashes in QSqlQueries! You should consult your trusted doctor!";
+        qCritical() << "Your version of Qt does something _VERY_ strange to slashes in QSqlQueries! You should consult your trusted doctor!";
         return false;
         break;
     }
         return false;
         break;
     }
@@ -121,7 +120,7 @@ bool PostgreSqlStorage::initDbSession(QSqlDatabase& db)
     // Set the PostgreSQL session timezone to UTC, since we want timestamps stored in UTC
     QSqlQuery tzQuery = db.exec("SET timezone = 'UTC'");
     if (tzQuery.lastError().isValid()) {
     // Set the PostgreSQL session timezone to UTC, since we want timestamps stored in UTC
     QSqlQuery tzQuery = db.exec("SET timezone = 'UTC'");
     if (tzQuery.lastError().isValid()) {
-        quError() << "Failed to set timezone to UTC!";
+        qCritical() << "Failed to set timezone to UTC!";
         return false;
     }
 
         return false;
     }
 
index 94c759c..a385254 100644 (file)
@@ -21,7 +21,6 @@
 #include "sqlauthenticator.h"
 
 #include "core.h"
 #include "sqlauthenticator.h"
 
 #include "core.h"
-#include "logmessage.h"
 #include "network.h"
 #include "quassel.h"
 
 #include "network.h"
 #include "quassel.h"
 
@@ -76,6 +75,6 @@ Authenticator::State SqlAuthenticator::init(const QVariantMap& settings, const Q
     // TODO: FIXME: this should check if the storage provider is ready, but I don't
     // know if there's an exposed way to do that at the moment.
 
     // TODO: FIXME: this should check if the storage provider is ready, but I don't
     // know if there's an exposed way to do that at the moment.
 
-    quInfo() << qPrintable(backendId()) << "authenticator is ready.";
+    qInfo() << qPrintable(backendId()) << "authenticator is ready.";
     return IsReady;
 }
     return IsReady;
 }
index 2d06421..d12262e 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <QtSql>
 
 
 #include <QtSql>
 
-#include "logmessage.h"
 #include "network.h"
 #include "quassel.h"
 
 #include "network.h"
 #include "quassel.h"
 
index c076a5f..d3b6070 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <QDateTime>
 
 
 #include <QDateTime>
 
-#include "logmessage.h"
 #include "quassel.h"
 
 #ifdef HAVE_SSL
 #include "quassel.h"
 
 #ifdef HAVE_SSL
@@ -54,9 +53,9 @@ SslServer::SslServer(QObject* parent)
     // Initialize the certificates for first-time usage
     if (!loadCerts()) {
         if (!sslWarningShown) {
     // Initialize the certificates for first-time usage
     if (!loadCerts()) {
         if (!sslWarningShown) {
-            quWarning() << "SslServer: Unable to set certificate file\n"
-                        << "          Quassel Core will still work, but cannot provide SSL for client connections.\n"
-                        << "          Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
+            qWarning() << "SslServer: Unable to set certificate file\n"
+                       << "          Quassel Core will still work, but cannot provide SSL for client connections.\n"
+                       << "          Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
             sslWarningShown = true;
         }
     }
             sslWarningShown = true;
         }
     }
@@ -102,14 +101,14 @@ bool SslServer::reloadCerts()
         // Reloading certificates currently only occur in response to a request.  Always print an
         // error if something goes wrong, in order to simplify checking if it's working.
         if (isCertValid()) {
         // Reloading certificates currently only occur in response to a request.  Always print an
         // error if something goes wrong, in order to simplify checking if it's working.
         if (isCertValid()) {
-            quWarning() << "SslServer: Unable to reload certificate file, reverting\n"
-                        << "          Quassel Core will use the previous key to provide SSL for client connections.\n"
-                        << "          Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
+            qWarning() << "SslServer: Unable to reload certificate file, reverting\n"
+                       << "          Quassel Core will use the previous key to provide SSL for client connections.\n"
+                       << "          Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
         }
         else {
         }
         else {
-            quWarning() << "SslServer: Unable to reload certificate file\n"
-                        << "          Quassel Core will still work, but cannot provide SSL for client connections.\n"
-                        << "          Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
+            qWarning() << "SslServer: Unable to reload certificate file\n"
+                       << "          Quassel Core will still work, but cannot provide SSL for client connections.\n"
+                       << "          Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
         }
         return false;
     }
         }
         return false;
     }
@@ -129,19 +128,19 @@ bool SslServer::setCertificate(const QString& path, const QString& keyPath)
 
     QFile certFile(path);
     if (!certFile.exists()) {
 
     QFile certFile(path);
     if (!certFile.exists()) {
-        quWarning() << "SslServer: Certificate file" << qPrintable(path) << "does not exist";
+        qWarning() << "SslServer: Certificate file" << qPrintable(path) << "does not exist";
         return false;
     }
 
     if (!certFile.open(QIODevice::ReadOnly)) {
         return false;
     }
 
     if (!certFile.open(QIODevice::ReadOnly)) {
-        quWarning() << "SslServer: Failed to open certificate file" << qPrintable(path) << "error:" << certFile.error();
+        qWarning() << "SslServer: Failed to open certificate file" << qPrintable(path) << "error:" << certFile.error();
         return false;
     }
 
     QList<QSslCertificate> certList = QSslCertificate::fromDevice(&certFile);
 
     if (certList.isEmpty()) {
         return false;
     }
 
     QList<QSslCertificate> certList = QSslCertificate::fromDevice(&certFile);
 
     if (certList.isEmpty()) {
-        quWarning() << "SslServer: Certificate file doesn't contain a certificate";
+        qWarning() << "SslServer: Certificate file doesn't contain a certificate";
         return false;
     }
 
         return false;
     }
 
@@ -152,7 +151,7 @@ bool SslServer::setCertificate(const QString& path, const QString& keyPath)
     untestedCA = certList;
 
     if (!certFile.reset()) {
     untestedCA = certList;
 
     if (!certFile.reset()) {
-        quWarning() << "SslServer: IO error reading certificate file";
+        qWarning() << "SslServer: IO error reading certificate file";
         return false;
     }
 
         return false;
     }
 
@@ -160,12 +159,12 @@ bool SslServer::setCertificate(const QString& path, const QString& keyPath)
     if (path != keyPath) {
         QFile keyFile(keyPath);
         if (!keyFile.exists()) {
     if (path != keyPath) {
         QFile keyFile(keyPath);
         if (!keyFile.exists()) {
-            quWarning() << "SslServer: Key file" << qPrintable(keyPath) << "does not exist";
+            qWarning() << "SslServer: Key file" << qPrintable(keyPath) << "does not exist";
             return false;
         }
 
         if (!keyFile.open(QIODevice::ReadOnly)) {
             return false;
         }
 
         if (!keyFile.open(QIODevice::ReadOnly)) {
-            quWarning() << "SslServer: Failed to open key file" << qPrintable(keyPath) << "error:" << keyFile.error();
+            qWarning() << "SslServer: Failed to open key file" << qPrintable(keyPath) << "error:" << keyFile.error();
             return false;
         }
 
             return false;
         }
 
@@ -179,24 +178,24 @@ bool SslServer::setCertificate(const QString& path, const QString& keyPath)
     certFile.close();
 
     if (untestedCert.isNull()) {
     certFile.close();
 
     if (untestedCert.isNull()) {
-        quWarning() << "SslServer:" << qPrintable(path) << "contains no certificate data";
+        qWarning() << "SslServer:" << qPrintable(path) << "contains no certificate data";
         return false;
     }
 
     // We allow the core to offer SSL anyway, so no "return false" here. Client will warn about the cert being invalid.
     const QDateTime now = QDateTime::currentDateTime();
     if (now < untestedCert.effectiveDate()) {
         return false;
     }
 
     // We allow the core to offer SSL anyway, so no "return false" here. Client will warn about the cert being invalid.
     const QDateTime now = QDateTime::currentDateTime();
     if (now < untestedCert.effectiveDate()) {
-        quWarning() << "SslServer: Certificate won't be valid before" << untestedCert.effectiveDate().toString();
+        qWarning() << "SslServer: Certificate won't be valid before" << untestedCert.effectiveDate().toString();
     }
     else if (now > untestedCert.expiryDate()) {
     }
     else if (now > untestedCert.expiryDate()) {
-        quWarning() << "SslServer: Certificate expired on" << untestedCert.expiryDate().toString();
+        qWarning() << "SslServer: Certificate expired on" << untestedCert.expiryDate().toString();
     }
     else if (untestedCert.isBlacklisted()) {
     }
     else if (untestedCert.isBlacklisted()) {
-        quWarning() << "SslServer: Certificate blacklisted";
+        qWarning() << "SslServer: Certificate blacklisted";
     }
 
     if (untestedKey.isNull()) {
     }
 
     if (untestedKey.isNull()) {
-        quWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
+        qWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
         return false;
     }
 
         return false;
     }
 
@@ -216,7 +215,7 @@ QSslKey SslServer::loadKey(QFile* keyFile)
     key = QSslKey(keyFile, QSsl::Rsa);
     if (key.isNull()) {
         if (!keyFile->reset()) {
     key = QSslKey(keyFile, QSsl::Rsa);
     if (key.isNull()) {
         if (!keyFile->reset()) {
-            quWarning() << "SslServer: IO error reading key file";
+            qWarning() << "SslServer: IO error reading key file";
             return key;
         }
         key = QSslKey(keyFile, QSsl::Ec);
             return key;
         }
         key = QSslKey(keyFile, QSsl::Ec);
index beee2cd..1cc07a4 100644 (file)
@@ -24,7 +24,6 @@
 #include "core.h"
 #include "coreapplication.h"
 #include "internalpeer.h"
 #include "core.h"
 #include "coreapplication.h"
 #include "internalpeer.h"
-#include "logmessage.h"
 #include "qtui.h"
 
 class InternalPeer;
 #include "qtui.h"
 
 class InternalPeer;
@@ -50,7 +49,7 @@ void MonolithicApplication::init()
 Quassel::QuitHandler MonolithicApplication::quitHandler()
 {
     return [this]() {
 Quassel::QuitHandler MonolithicApplication::quitHandler()
 {
     return [this]() {
-        quInfo() << "Client shutting down...";
+        qInfo() << "Client shutting down...";
         connect(_client.get(), &QObject::destroyed, this, &MonolithicApplication::onClientDestroyed);
         _client.release()->deleteLater();
     };
         connect(_client.get(), &QObject::destroyed, this, &MonolithicApplication::onClientDestroyed);
         _client.release()->deleteLater();
     };
index 11ee358..cd5d98a 100644 (file)
@@ -25,7 +25,6 @@
 #include <QStringList>
 
 #include "chatviewsettings.h"
 #include <QStringList>
 
 #include "chatviewsettings.h"
-#include "logmessage.h"
 #include "mainwin.h"
 #include "qtui.h"
 #include "qtuisettings.h"
 #include "mainwin.h"
 #include "qtui.h"
 #include "qtuisettings.h"
@@ -65,7 +64,7 @@ Quassel::QuitHandler QtUiApplication::quitHandler()
 {
     // Wait until the Client instance is destroyed before quitting the event loop
     return [this]() {
 {
     // Wait until the Client instance is destroyed before quitting the event loop
     return [this]() {
-        quInfo() << "Client shutting down...";
+        qInfo() << "Client shutting down...";
         connect(_client.get(), &QObject::destroyed, QCoreApplication::instance(), &QCoreApplication::quit);
         _client.release()->deleteLater();
     };
         connect(_client.get(), &QObject::destroyed, QCoreApplication::instance(), &QCoreApplication::quit);
         _client.release()->deleteLater();
     };