MyGUI_LogSource.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_LOG_SOURCE_H_
#define MYGUI_LOG_SOURCE_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_ILogFilter.h"
#include "MyGUI_ILogListener.h"
#include <vector>
namespace MyGUI
{
class MYGUI_EXPORT LogSource
{
public:
void setLogFilter(ILogFilter* _filter);
void addLogListener(ILogListener* _lestener);
void open();
void close();
void flush();
void log(
std::string_view _section,
LogLevel _level,
const struct tm* _time,
std::string_view _message,
std::string_view _file,
int _line);
private:
using VectorLogListeners = std::vector<ILogListener*>;
VectorLogListeners mListeners;
ILogFilter* mFilter{nullptr};
};
} // namespace MyGUI
#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