MyGUI  3.4.1
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 
19  public ILogListener
20  {
21  public:
23  void open() override;
25  void close() override;
27  void flush() override;
29  void log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line) override;
30 
32  void setFileName(const std::string& _value);
34  const std::string& getFileName() const;
35 
36  private:
37  std::ofstream mStream;
38  std::string mFileName;
39  };
40 
41 } // namespace MyGUI
42 
43 #endif // MYGUI_FILE_LOG_LISTENER_H_
#define MYGUI_EXPORT