logsink.h
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
00022
00023 namespace gloox
00024 {
00025
00038 class GLOOX_API LogSink
00039 {
00040 public:
00044 LogSink();
00045
00049 virtual ~LogSink();
00050
00057 void log( LogLevel level, LogArea area, const std::string& message ) const;
00058
00066 void registerLogHandler( LogLevel level, int areas, LogHandler *lh );
00067
00072 void removeLogHandler( LogHandler *lh );
00073
00074 private:
00075 struct LogInfo
00076 {
00077 LogLevel level;
00078 int areas;
00079 };
00080
00081 LogSink( const LogSink& ) {}
00082
00083 typedef std::map<LogHandler*, LogInfo> LogHandlerMap;
00084 LogHandlerMap m_logHandlers;
00085
00086 int m_fileFilter;
00087
00088 };
00089
00090 }
00091
00092 #endif // LOGSINK_H__