MyGUI  3.2.1
MyGUI_LogSource.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_LOG_SOURCE_H__
00008 #define __MYGUI_LOG_SOURCE_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_ILogFilter.h"
00012 #include "MyGUI_ILogListener.h"
00013 #include <vector>
00014 
00015 namespace MyGUI
00016 {
00017 
00018     class MYGUI_EXPORT LogSource
00019     {
00020     public:
00021         LogSource();
00022         ~LogSource();
00023 
00025         void setLogFilter(ILogFilter* _filter);
00027         void addLogListener(ILogListener* _lestener);
00028 
00030         void open();
00032         void close();
00034         void flush();
00036         void log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line);
00037 
00038     private:
00039         typedef std::vector<ILogListener*> VectorLogListeners;
00040         VectorLogListeners mListeners;
00041         ILogFilter* mFilter;
00042     };
00043 
00044 } // namespace MyGUI
00045 
00046 #endif // __MYGUI_LOG_SOURCE_H__