projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix and improve logging support
[quassel.git]
/
src
/
common
/
quassel.h
diff --git
a/src/common/quassel.h
b/src/common/quassel.h
index
86469c4
..
30e02b2
100644
(file)
--- a/
src/common/quassel.h
+++ b/
src/common/quassel.h
@@
-27,6
+27,8
@@
#include "abstractcliparser.h"
#include "abstractcliparser.h"
+class QFile;
+
class Quassel {
Q_DECLARE_TR_FUNCTIONS(Quassel)
class Quassel {
Q_DECLARE_TR_FUNCTIONS(Quassel)
@@
-121,6
+123,17
@@
public:
static bool DEBUG;
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:
static void logFatalMessage(const char *msg);
protected:
@@
-150,6
+163,10
@@
private:
static QString _configDirPath;
static QStringList _dataDirPaths;
static QString _translationDirPath;
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);
};
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); }
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
#endif