X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fmain.cpp;h=234891c79aa49a74754619fd36ba015abb275904;hp=628c1a833401591619763044a573bbc000798ce2;hb=493043890c74e4679bb3fdaf512a0e1e52c426d3;hpb=cb63e88d483f74c8f2f6e06c35c9d18be45cebaa diff --git a/src/common/main.cpp b/src/common/main.cpp index 628c1a83..234891c7 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -71,6 +71,7 @@ Q_IMPORT_PLUGIN(qgif) #endif #include "quassel.h" +#include "types.h" int main(int argc, char **argv) { @@ -78,6 +79,9 @@ int main(int argc, char **argv) umask(S_IRWXG | S_IRWXO); #endif + // Instantiate early, so log messages are handled + Quassel quassel; + #if QT_VERSION < 0x050000 // All our source files are in UTF-8, and Qt5 even requires that QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); @@ -198,6 +202,12 @@ int main(int argc, char **argv) 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 @@ -238,8 +248,15 @@ int main(int argc, char **argv) AboutData::setQuasselPersons(&aboutData); KAboutData::setApplicationData(aboutData.kAboutData()); #endif - if (!app.init()) - return EXIT_FAILURE; + try { + app.init(); + } + catch (ExitException e) { + if (!e.errorString.isEmpty()) { + qCritical() << e.errorString; + } + return e.exitCode; + } return app.exec(); }