common: Add "--debug-irc" to log raw IRC messages
authorShane Synan <digitalcircuit36939@gmail.com>
Mon, 3 Sep 2018 04:36:23 +0000 (23:36 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 3 Sep 2018 20:16:06 +0000 (22:16 +0200)
commitdce2be6d7f9af7dcc0133ee7f0f42e9ef47be568
tree073ee75df08acab12dc5b3eeba4bff6a19a5d47b
parent48dda5f3e963e13e36300ddaef262660bf169672
common: Add "--debug-irc" to log raw IRC messages

Add "--debug-irc" command-line option to Core and Monolithic to log
raw IRC messages to the log at Debug level.

Check for raw IRC logging in CoreNetwork and IrcParser, logging
anything sent and received with the Network ID and "<<" for received,
">>" for sent.

Add "--debug-irc-id" to limit raw logging to a specific Network ID,
handy for cores with multiple networks.  This option automatically
applies "--debug-irc".

These usually should be combined with "--loglevel Debug", though the
Monolithic build can show raw IRC messages in the "Debug Log" GUI
without setting that parameter.

CAUTION:  "--debug-irc" will leak all IRC passwords in plain text via
any configured logging receivers (file, syslog, etc) and should not
be used on production servers without taking special care to limit
access to logging output.

Note: The ideal approach is to have the core maintain the most recent
raw IRC logs on a rotating basis, allowing any client to request this
portion of logs on demand.  However, there's a lot more changes
involved, which might not be wise with the goal of stabilizing 0.13.

We should revisit this in the future.
src/common/main.cpp
src/core/corenetwork.cpp
src/core/corenetwork.h
src/core/ircparser.cpp
src/core/ircparser.h