MyGUI: MyGUI_FileLogListener.h Source File

MyGUI 3.2.2

MyGUI_FileLogListener.h
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #ifndef MYGUI_FILE_LOG_LISTENER_H_
8 #define MYGUI_FILE_LOG_LISTENER_H_
9
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_ILogListener.h"
12 #include <fstream>
13 #include <string>
14
15 namespace MyGUI
16 {
17
18 class MYGUI_EXPORT FileLogListener :
19 public ILogListener
20 {
21 public:
22 FileLogListener();
23 virtual ~FileLogListener();
24
26 virtual void open();
28 virtual void close();
30 virtual void flush();
32 virtual void log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line);
33
35 void setFileName(const std::string& _value);
37 const std::string& getFileName() const;
38
39 private:
40 std::ofstream mStream;
41 std::string mFileName;
42 };
43
44 } // namespace MyGUI
45
46 #endif // MYGUI_FILE_LOG_LISTENER_H_
MyGUI_ILogListener.h
MyGUI_Prerequest.h
MyGUI::FileLogListener
Definition: MyGUI_FileLogListener.h:18
MyGUI::ILogListener
Definition: MyGUI_ILogListener.h:16
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::LogLevel
Definition: MyGUI_LogLevel.h:15
MyGUI
Definition: MyGUI_ActionController.h:14