MyGUI: MyGUI_LogSource.h Source File

MyGUI 3.4.3

MyGUI_LogSource.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_LOG_SOURCE_H_
8#define MYGUI_LOG_SOURCE_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_ILogFilter.h"
12#include "MyGUI_ILogListener.h"
13#include <vector>
14
15namespace MyGUI
16{
17
18 class MYGUI_EXPORT LogSource
19 {
20 public:
22 void setLogFilter(ILogFilter* _filter);
24 void addLogListener(ILogListener* _lestener);
25
27 void open();
29 void close();
31 void flush();
33 void log(
34 std::string_view _section,
35 LogLevel _level,
36 const struct tm* _time,
37 std::string_view _message,
38 std::string_view _file,
39 int _line);
40
41 private:
42 using VectorLogListeners = std::vector<ILogListener*>;
43 VectorLogListeners mListeners;
44 ILogFilter* mFilter{nullptr};
45 };
46
47} // namespace MyGUI
48
49#endif // MYGUI_LOG_SOURCE_H_
MyGUI_ILogFilter.h
MyGUI_ILogListener.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI::ILogFilter
Definition MyGUI_ILogFilter.h:17
MyGUI::ILogListener
Definition MyGUI_ILogListener.h:17
MyGUI::LogSource
Definition MyGUI_LogSource.h:19
MyGUI::LogSource::setLogFilter
void setLogFilter(ILogFilter *_filter)
Definition MyGUI_LogSource.cpp:13
MyGUI::LogSource::close
void close()
Definition MyGUI_LogSource.cpp:29
MyGUI::LogSource::flush
void flush()
Definition MyGUI_LogSource.cpp:35
MyGUI::LogSource::open
void open()
Definition MyGUI_LogSource.cpp:23
MyGUI::LogSource::log
void log(std::string_view _section, LogLevel _level, const struct tm *_time, std::string_view _message, std::string_view _file, int _line)
Definition MyGUI_LogSource.cpp:41
MyGUI::LogSource::addLogListener
void addLogListener(ILogListener *_lestener)
Definition MyGUI_LogSource.cpp:18
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::LogLevel
Definition MyGUI_LogLevel.h:19