class QFile;
+class Logger;
+
class Quassel : public QObject
{
// TODO Qt5: Use Q_GADGET
SenderPrefixes, ///< Show prefixes for senders in backlog
RemoteDisconnect, ///< Allow this peer to be remotely disconnected
ExtendedFeatures, ///< Extended features
- LongMessageTime, ///< Serialize message time as 64-bit
+ 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)
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();
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<bool()>;
static void registerReloadHandler(ReloadHandler handler);
static void registerQuitHandler(QuitHandler quitHandler);
+ const QString &coreDumpFileName();
+
+signals:
+ void messageLogged(const QDateTime &timeStamp, const QString &msg);
+
protected:
static bool init();
static void destroy();
void setupEnvironment();
void registerMetaTypes();
- const QString &coreDumpFileName();
-
/**
* Requests a reload of relevant runtime configuration.
*
QStringList _dataDirPaths;
QString _translationDirPath;
- LogLevel _logLevel{InfoLevel};
- bool _logToSyslog{false};
- std::unique_ptr<QFile> _logFile;
-
std::shared_ptr<AbstractCliParser> _cliParser;
+ Logger *_logger;
+
std::vector<ReloadHandler> _reloadHandlers;
std::vector<QuitHandler> _quitHandlers;
};