X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fquassel.h;h=85660afc8edfa311165d54e20242934f7fe099d9;hp=16e12e9a7da483a0959f06820ec9441a103f8ff8;hb=c27d5bfbe80bfeb583a25404f4ccee4b70b010e0;hpb=9f91e0dd3c4eb5c2e2dedfc8d36a068d433d51b1 diff --git a/src/common/quassel.h b/src/common/quassel.h index 16e12e9a..85660afc 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -35,6 +35,8 @@ class QFile; +class Logger; + class Quassel : public QObject { // TODO Qt5: Use Q_GADGET @@ -111,7 +113,11 @@ public: * * This list should be cleaned up after every protocol break, as we can assume them to be present then. */ - enum class Feature : quint32 { + #if QT_VERSION >= 0x050000 + enum class Feature : uint32_t { + #else + enum Feature { + #endif SynchronizedMarkerLine, SaslAuthentication, SaslExternal, @@ -127,6 +133,14 @@ public: SenderPrefixes, ///< Show prefixes for senders in backlog RemoteDisconnect, ///< Allow this peer to be remotely disconnected ExtendedFeatures, ///< Extended features + LongTime, ///< Serialize time as 64-bit values + RichMessages, ///< Real Name and Avatar URL in backlog + BacklogFilterType, ///< BacklogManager supports filtering backlog by MessageType +#if QT_VERSION >= 0x050500 + EcdsaCertfpKeys, ///< ECDSA keys for CertFP in identities +#endif + LongMessageId, ///< 64-bit IDs for messages + SyncedCoreInfo, ///< CoreInfo dynamically updated using signals }; Q_ENUMS(Feature) @@ -134,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(); @@ -170,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); @@ -192,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(); @@ -211,8 +223,6 @@ private: void setupEnvironment(); void registerMetaTypes(); - const QString &coreDumpFileName(); - /** * Requests a reload of relevant runtime configuration. * @@ -245,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; };