MyGUI 3.4.3
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
19 {
20 public:
22 void open() override;
24 void close() override;
26 void flush() override;
28 void log(
29 std::string_view _section,
30 LogLevel _level,
31 const struct tm* _time,
32 std::string_view _message,
33 std::string_view _file,
34 int _line) override;
35
37 void setFileName(std::string_view _value);
39 const std::string& getFileName() const;
40
41 private:
42 std::ofstream mStream;
43 std::string mFileName;
44 };
45
46} // namespace MyGUI
47
48#endif // MYGUI_FILE_LOG_LISTENER_H_
#define MYGUI_EXPORT