options += {
{"debug-irc", tr("Enable logging of all raw IRC messages to debug log, including passwords! In most cases you should also set --loglevel Debug")},
{"debug-irc-id", tr("Limit raw IRC logging to this network ID. Implies --debug-irc"), tr("database network ID"), "-1"},
+ {"debug-irc-parsed", tr("Enable logging of all parsed IRC messages to debug log, including passwords! In most cases you should also set --loglevel Debug")},
+ {"debug-irc-parsed-id", tr("Limit parsed IRC logging to this network ID. Implies --debug-irc-parsed"), tr("database network ID"), "-1"},
};
}
// Check if raw IRC logging is enabled
_debugLogRawIrc = (Quassel::isOptionSet("debug-irc") || Quassel::isOptionSet("debug-irc-id"));
_debugLogRawNetId = Quassel::optionValue("debug-irc-id").toInt();
+ // Check if parsed IRC logging is enabled
+ _debugLogParsedIrc = (Quassel::isOptionSet("debug-irc-parsed") || Quassel::isOptionSet("debug-irc-parsed-id"));
+ _debugLogParsedNetId = Quassel::optionValue("debug-irc-parsed-id").toInt();
connect(this, &IrcParser::newEvent, coreSession()->eventManager(), &EventManager::postEvent);
}
return net->serverDecode(data);
}, rawMsg, tags, prefix, cmd, params);
+ // Log the message if enabled and network ID matches or allows all
+ if (_debugLogParsedIrc && (_debugLogParsedNetId == -1 || net->networkId().toInt() == _debugLogParsedNetId)) {
+ // Include network ID
+ qDebug() << "IRC net" << net->networkId() << "<<" << tags << prefix << cmd << params;
+ }
+
QList<Event*> events;
EventManager::EventType type = EventManager::Invalid;
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
+ bool _debugLogParsedIrc; ///< If true, include parsed IRC socket messages in the debug log
+ qint32 _debugLogParsedNetId; ///< Network ID for logging parsed IRC socket messages, or -1 for all
};