MyGUI: MyGUI_FileLogListener.h Source File

MyGUI 3.4.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

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
15namespace MyGUI
16{
17
18 class MYGUI_EXPORT FileLogListener :
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_
MyGUI_ILogListener.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI::FileLogListener
Definition MyGUI_FileLogListener.h:20
MyGUI::ILogListener
Definition MyGUI_ILogListener.h:17
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::LogLevel
Definition MyGUI_LogLevel.h:19