00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef LOGSINK_H__
00015 #define LOGSINK_H__
00016
00017 #include "gloox.h"
00018 #include "loghandler.h"
00019
00020 #include <string>
00021 #include <fstream>
00022
00023 namespace gloox
00024 {
00025
00032 class GLOOX_API LogSink
00033 {
00034 public:
00038 LogSink();
00039
00043 virtual ~LogSink();
00044
00051 void log( LogLevel level, LogArea area, const std::string& message ) const;
00052
00060 void registerLogHandler( LogLevel level, int areas, LogHandler *lh );
00061
00066 void removeLogHandler( LogHandler *lh );
00067
00068 private:
00069 struct LogInfo
00070 {
00071 LogLevel level;
00072 int areas;
00073 };
00074
00075 LogSink( const LogSink& ) {};
00076
00077 typedef std::map<LogHandler*, LogInfo> LogHandlerMap;
00078 LogHandlerMap m_logHandlers;
00079
00080 int m_fileFilter;
00081
00082 };
00083
00084 }
00085
00086 #endif // LOGSINK_H__