#include "client.h"
#include "clientsettings.h"
-#include "logmessage.h"
#include "peerfactory.h"
#include "util.h"
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()) {
- 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();
irclisthelper.cpp
ircuser.cpp
logger.cpp
- logmessage.cpp
message.cpp
messageevent.cpp
network.cpp
#include <QString>
#include <QStringList>
-#include "logmessage.h"
-
ExpressionMatch::ExpressionMatch(const QString& expression, MatchMode mode, bool caseSensitive)
{
// Store the original parameters for later reference
// 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";
}
}
+++ /dev/null
-/***************************************************************************
- * 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;
-}
+++ /dev/null
-/***************************************************************************
- * 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)
- {}
-};
#include <QDebug>
#include <QSocketNotifier>
-#include "logmessage.h"
-
int PosixSignalWatcher::_sockpair[2];
PosixSignalWatcher::PosixSignalWatcher(QObject* parent)
int signal;
auto bytes = ::read(sockfd, &signal, sizeof(signal));
Q_UNUSED(bytes)
- quInfo() << "Caught signal" << signal;
+ qInfo() << "Caught signal" << signal;
switch (signal) {
case SIGHUP:
#include "bufferinfo.h"
#include "identity.h"
#include "logger.h"
-#include "logmessage.h"
#include "message.h"
#include "network.h"
#include "peer.h"
// Protect against multiple invocations (e.g. triggered by MainWin::closeEvent())
if (!_quitting) {
_quitting = true;
- quInfo() << "Quitting...";
+ qInfo() << "Quitting...";
if (_quitHandlers.empty()) {
QCoreApplication::quit();
}
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()) {
- quInfo() << "Successfully reloaded configuration";
+ qInfo() << "Successfully reloaded configuration";
}
}
break;
quit();
}
else {
- quInfo() << "Already shutting down, ignoring signal";
+ qInfo() << "Already shutting down, ignoring signal";
}
break;
case AbstractSignalWatcher::Action::HandleCrash:
#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
void WindowsSignalWatcher::signalHandler(int signal)
{
- quInfo() << "Caught signal" << signal;
+ qInfo() << "Caught signal" << signal;
switch (signal) {
case SIGINT:
#include <QSqlField>
#include <QSqlQuery>
-#include "logmessage.h"
#include "quassel.h"
int AbstractSqlStorage::_nextConnectionId = 0;
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)) {
- quWarning() << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread();
+ qWarning() << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread();
db.close();
}
}
}
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()));
}
// 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;
}
#include "cipher.h"
-#include "logmessage.h"
-
Cipher::Cipher()
{
m_primeNum = QCA::BigInteger(
#include "coresession.h"
#include "coresettings.h"
#include "internalpeer.h"
-#include "logmessage.h"
#include "network.h"
#include "postgresqlstorage.h"
#include "quassel.h"
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 {
void Core::shutdown()
{
- quInfo() << "Core shutting down...";
+ qInfo() << "Core shutting down...";
saveState();
{
_sessions.take(_sessions.key(session))->deleteLater();
if (_sessions.isEmpty()) {
- quInfo() << "Core shutdown complete!";
+ qInfo() << "Core shutdown complete!";
emit shutdownComplete();
}
}
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()) {
- quWarning() << qPrintable(tr("Calling restoreState() even though active sessions exist!"));
+ qWarning() << qPrintable(tr("Calling restoreState() even though active sessions exist!"));
return;
}
/* 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;
}
*/
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);
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!");
}
}
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
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;
}
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;
}
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
- 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)) {
- 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)
- 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:
}
}
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 (wasListening) {
if (reason.isEmpty())
- quInfo() << "No longer listening for GUI clients.";
+ qInfo() << "No longer listening for GUI clients.";
else
- quInfo() << qPrintable(reason);
+ qInfo() << qPrintable(reason);
}
}
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."));
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();
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) {
- quWarning() << "Client peer went away, not starting a session";
+ qWarning() << "Client peer went away, not starting a session";
return;
}
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()
_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;
}
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)) {
- 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) {
- 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."));
}
- quWarning() << qPrintable(tr("Switched storage backend to: %1").arg(backend));
+ qWarning() << qPrintable(tr("Switched storage backend to: %1").arg(backend));
break;
}
}
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) {
- quWarning() << qPrintable(tr("No currently active storage backend. Skipping migration..."));
+ qWarning() << qPrintable(tr("No currently active storage backend. Skipping migration..."));
}
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) {
- 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/
_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;
}
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)) {
- 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) {
- 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);
- quWarning() << qPrintable(tr("Switched authenticator to: %1").arg(backend));
+ qWarning() << qPrintable(tr("Switched authenticator to: %1").arg(backend));
}
_authenticator = std::move(auther);
enableStdInEcho();
if (password != password2) {
- quWarning() << "Passwords don't match!";
+ qWarning() << "Passwords don't match!";
return false;
}
if (password.isEmpty()) {
- quWarning() << "Password is empty!";
+ qWarning() << "Password is empty!";
return false;
}
return true;
}
else {
- quWarning() << "Unable to add user:" << qPrintable(username);
+ qWarning() << "Unable to add user:" << qPrintable(username);
return false;
}
}
enableStdInEcho();
if (password != password2) {
- quWarning() << "Passwords don't match!";
+ qWarning() << "Passwords don't match!";
return false;
}
if (password.isEmpty()) {
- quWarning() << "Password is empty!";
+ qWarning() << "Password is empty!";
return false;
}
return true;
}
else {
- quWarning() << "Failed to change password!";
+ qWarning() << "Failed to change password!";
return false;
}
}
#endif
#include "core.h"
-#include "logmessage.h"
using namespace Protocol;
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;
// 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 (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());
- 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"))
- quInfo() << qPrintable(tr("Client does not support extended features."));
+ qInfo() << qPrintable(tr("Client does not support extended features."));
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()) {
- 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);
#include "corebasichandler.h"
-#include "logmessage.h"
#include "util.h"
CoreBasicHandler::CoreBasicHandler(CoreNetwork* parent)
#include "ircchannel.h"
#include "ircparser.h"
#include "ircuser.h"
-#include "logmessage.h"
#include "messageevent.h"
#include "remotepeer.h"
#include "storage.h"
{
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());
}
#include "ctcpevent.h"
#include "ircevent.h"
#include "ircuser.h"
-#include "logmessage.h"
#include "messageevent.h"
#include "netsplit.h"
#include "quassel.h"
{
// 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;
}
#include <limits>
#include "corenetwork.h"
-#include "logmessage.h"
IdentServer::IdentServer(QObject* parent)
: QObject(parent)
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)) {
- 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) {
- 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;
if (wasListening) {
if (msg.isEmpty())
- quInfo() << "No longer listening for identd clients.";
+ qInfo() << "No longer listening for identd clients.";
else
- quInfo() << qPrintable(msg);
+ qInfo() << qPrintable(msg);
}
}
#include "ldapauthenticator.h"
-#include "logmessage.h"
#include "network.h"
#include "quassel.h"
bool status = ldapConnect();
if (!status) {
- quInfo() << qPrintable(backendId()) << "authenticator cannot connect.";
+ qInfo() << qPrintable(backendId()) << "authenticator cannot connect.";
return NotAvailable;
}
- quInfo() << qPrintable(backendId()) << "authenticator is ready.";
+ qInfo() << qPrintable(backendId()) << "authenticator is ready.";
return IsReady;
}
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);
#include <QtSql>
-#include "logmessage.h"
#include "network.h"
#include "quassel.h"
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;
}
// 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 (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
- 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;
}
// 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;
}
#include "sqlauthenticator.h"
#include "core.h"
-#include "logmessage.h"
#include "network.h"
#include "quassel.h"
// 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;
}
#include <QtSql>
-#include "logmessage.h"
#include "network.h"
#include "quassel.h"
#include <QDateTime>
-#include "logmessage.h"
#include "quassel.h"
#ifdef HAVE_SSL
// 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;
}
}
// 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 {
- 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;
}
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)) {
- 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()) {
- quWarning() << "SslServer: Certificate file doesn't contain a certificate";
+ qWarning() << "SslServer: Certificate file doesn't contain a certificate";
return false;
}
untestedCA = certList;
if (!certFile.reset()) {
- quWarning() << "SslServer: IO error reading certificate file";
+ qWarning() << "SslServer: IO error reading certificate file";
return false;
}
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)) {
- 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;
}
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()) {
- 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()) {
- quWarning() << "SslServer: Certificate expired on" << untestedCert.expiryDate().toString();
+ qWarning() << "SslServer: Certificate expired on" << untestedCert.expiryDate().toString();
}
else if (untestedCert.isBlacklisted()) {
- quWarning() << "SslServer: Certificate blacklisted";
+ qWarning() << "SslServer: Certificate blacklisted";
}
if (untestedKey.isNull()) {
- quWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
+ qWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
return false;
}
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);
#include "core.h"
#include "coreapplication.h"
#include "internalpeer.h"
-#include "logmessage.h"
#include "qtui.h"
class InternalPeer;
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();
};
#include <QStringList>
#include "chatviewsettings.h"
-#include "logmessage.h"
#include "mainwin.h"
#include "qtui.h"
#include "qtuisettings.h"
{
// 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();
};