X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fquassel.h;h=30e02b201fa932013c05c6040bdad6c14f763ae7;hp=86469c48f0309270d8b2ffd8b4323c5878999a76;hb=98bec7bab038a8e656f90617c59fe1e8c0907f71;hpb=2deb46a3ce819c709800f1ded9072e62807b9574 diff --git a/src/common/quassel.h b/src/common/quassel.h index 86469c48..30e02b20 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -27,6 +27,8 @@ #include "abstractcliparser.h" +class QFile; + class Quassel { Q_DECLARE_TR_FUNCTIONS(Quassel) @@ -121,6 +123,17 @@ public: static bool DEBUG; + enum LogLevel { + DebugLevel, + InfoLevel, + WarningLevel, + ErrorLevel + }; + + static inline LogLevel logLevel(); + static inline QFile *logFile(); + static inline bool logToSyslog(); + static void logFatalMessage(const char *msg); protected: @@ -150,6 +163,10 @@ private: static QString _configDirPath; static QStringList _dataDirPaths; static QString _translationDirPath; + + static LogLevel _logLevel; + static QFile *_logFile; + static bool _logToSyslog; }; Q_DECLARE_OPERATORS_FOR_FLAGS(Quassel::Features); @@ -165,4 +182,8 @@ AbstractCliParser *Quassel::cliParser() { return _cliParser; } QString Quassel::optionValue(const QString &key) { return cliParser()->value(key); } bool Quassel::isOptionSet(const QString &key) { return cliParser()->isSet(key); } +Quassel::LogLevel Quassel::logLevel() { return _logLevel; } +QFile *Quassel::logFile() { return _logFile; } +bool Quassel::logToSyslog() { return _logToSyslog; } + #endif