cliParser->addOption("ssl-cert", 0, "Specify the path to the SSL Certificate", "path", "configdir/quasselCert.pem");
cliParser->addOption("ssl-key", 0, "Specify the path to the SSL key", "path", "ssl-cert-path");
#endif
+ cliParser->addSwitch("debug-irc", 0,
+ "Enable logging of all raw IRC messages to debug log, including "
+ "passwords! In most cases you should also set --loglevel Debug");
+ cliParser->addOption("debug-irc-id", 0,
+ "Limit raw IRC logging to this network ID. Implies --debug-irc",
+ "database network ID", "-1");
cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
#endif
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QHostInfo>
-
#include "corenetwork.h"
+#include <QDebug>
+#include <QHostInfo>
+
#include "core.h"
#include "coreidentity.h"
#include "corenetworkconfig.h"
_requestedUserModes('-')
{
+ // Check if raw IRC logging is enabled
+ _debugLogRawIrc = (Quassel::isOptionSet("debug-irc") || Quassel::isOptionSet("debug-irc-id"));
+ _debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
+
_autoReconnectTimer.setSingleShot(true);
connect(&_socketCloseTimer, SIGNAL(timeout()), this, SLOT(socketCloseTimeout()));
void CoreNetwork::writeToSocket(const QByteArray &data)
{
+ // Log the message if enabled and network ID matches or allows all
+ if (_debugLogRawIrc
+ && (_debugLogRawNetId == -1 || networkId().toInt() == _debugLogRawNetId)) {
+ // Include network ID
+ qDebug() << "IRC net" << networkId() << ">>" << data;
+ }
socket.write(data);
socket.write("\r\n");
if (!_skipMessageRates) {
private:
CoreSession *_coreSession;
+ bool _debugLogRawIrc; ///< If true, include raw IRC socket messages in the debug log
+ qint32 _debugLogRawNetId; ///< Network ID for logging raw IRC socket messages, or -1 for all
+
#ifdef HAVE_SSL
QSslSocket socket;
#else
#include "ircparser.h"
+#include <QDebug>
+
#include "corenetwork.h"
#include "eventmanager.h"
#include "ircevent.h"
QObject(session),
_coreSession(session)
{
+ // Check if raw IRC logging is enabled
+ _debugLogRawIrc = (Quassel::isOptionSet("debug-irc") || Quassel::isOptionSet("debug-irc-id"));
+ _debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
+
connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
}
return;
}
+ // Log the message if enabled and network ID matches or allows all
+ if (_debugLogRawIrc
+ && (_debugLogRawNetId == -1 || net->networkId().toInt() == _debugLogRawNetId)) {
+ // Include network ID
+ qDebug() << "IRC net" << net->networkId() << "<<" << msg;
+ }
+
// Now we split the raw message into its various parts...
QString prefix;
QByteArray trailing;
private:
CoreSession *_coreSession;
+
+ bool _debugLogRawIrc; ///< If true, include raw IRC socket messages in the debug log
+ qint32 _debugLogRawNetId; ///< Network ID for logging raw IRC socket messages, or -1 for all
};