X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fquassel.h;fp=src%2Fcommon%2Fquassel.h;h=85660afc8edfa311165d54e20242934f7fe099d9;hp=952f8fa8513e7381a86b1a7031f9d6c966c5f7a0;hb=37110ceaa070167b4f40ed449ac9ea130503a792;hpb=f42dc2dd4b22600ca1dc6d8bdcc94aa16dda8276 diff --git a/src/common/quassel.h b/src/common/quassel.h index 952f8fa8..85660afc 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -35,6 +35,8 @@ class QFile; +class Logger; + class Quassel : public QObject { // TODO Qt5: Use Q_GADGET @@ -146,6 +148,13 @@ public: static Quassel *instance(); + /** + * Provides access to the Logger instance. + * + * @returns The Logger instance + */ + Logger *logger() const; + static void setupBuildInfo(); static const BuildInfo &buildInfo(); static RunMode runMode(); @@ -182,20 +191,6 @@ public: static QString optionValue(const QString &option); static bool isOptionSet(const QString &option); - enum LogLevel { - DebugLevel, - InfoLevel, - WarningLevel, - ErrorLevel - }; - - static LogLevel logLevel(); - static void setLogLevel(LogLevel logLevel); - static QFile *logFile(); - static bool logToSyslog(); - - static void logFatalMessage(const char *msg); - using ReloadHandler = std::function; static void registerReloadHandler(ReloadHandler handler); @@ -204,6 +199,11 @@ public: static void registerQuitHandler(QuitHandler quitHandler); + const QString &coreDumpFileName(); + +signals: + void messageLogged(const QDateTime &timeStamp, const QString &msg); + protected: static bool init(); static void destroy(); @@ -223,8 +223,6 @@ private: void setupEnvironment(); void registerMetaTypes(); - const QString &coreDumpFileName(); - /** * Requests a reload of relevant runtime configuration. * @@ -257,12 +255,10 @@ private: QStringList _dataDirPaths; QString _translationDirPath; - LogLevel _logLevel{InfoLevel}; - bool _logToSyslog{false}; - std::unique_ptr _logFile; - std::shared_ptr _cliParser; + Logger *_logger; + std::vector _reloadHandlers; std::vector _quitHandlers; };