00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QXMPPLOGGER_H
00026 #define QXMPPLOGGER_H
00027
00028 #include <QObject>
00029
00033
00034 class QXmppLogger : public QObject
00035 {
00036 Q_OBJECT
00037
00038 public:
00040 enum LoggingType
00041 {
00042 NoLogging = 0,
00043 FileLogging = 1,
00044 StdoutLogging = 2,
00045 SignalLogging = 4,
00046
00047
00049 NONE = 0,
00050 FILE = 1,
00051 STDOUT = 2
00052
00053 };
00054
00056 enum MessageType
00057 {
00058 DebugMessage = 0,
00059 InformationMessage,
00060 WarningMessage,
00061 ReceivedMessage,
00062 SentMessage,
00063 };
00064
00065 QXmppLogger(QObject *parent = 0);
00066 static QXmppLogger* getLogger();
00067
00068 QXmppLogger::LoggingType loggingType();
00069 void setLoggingType(QXmppLogger::LoggingType type);
00070
00071 QString logFilePath();
00072 void setLogFilePath(const QString &path);
00073
00074 public slots:
00075 void log(QXmppLogger::MessageType type, const QString& text);
00076
00077 signals:
00079 void message(QXmppLogger::MessageType type, const QString &text);
00080
00081 private:
00082 static QXmppLogger* m_logger;
00083 QXmppLogger::LoggingType m_loggingType;
00084 QString m_logFilePath;
00085 };
00086
00087 #endif // QXMPPLOGGER_H