galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
LogPanel.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_UI_PANELS_LOGPANEL_HPP_
9#define GALAXY_UI_PANELS_LOGPANEL_HPP_
10
14
15namespace galaxy
16{
20 class EditorSink final : public Sink
21 {
22 public:
26 EditorSink() = default;
27
31 virtual ~EditorSink() noexcept;
32
38 void sink(const LogMessage& message) override;
39
43 void clear();
44
50 const std::vector<LogMessage>& get_messages() const;
51
52 private:
57 };
58
62 class LogPanel final : public Panel
63 {
64 public:
68 LogPanel() noexcept;
69
73 virtual ~LogPanel() noexcept;
74
78 void draw() override;
79
80 private:
85
90
95
100
105 };
106} // namespace galaxy
107
108#endif
Sink to display log messages in overlay editor.
Definition LogPanel.hpp:21
std::vector< LogMessage > m_logs
Stored logs.
Definition LogPanel.hpp:56
void sink(const LogMessage &message) override
Sink the message.
Definition LogPanel.cpp:20
void clear()
Clear all logs stored.
Definition LogPanel.cpp:25
EditorSink()=default
Constructor.
const std::vector< LogMessage > & get_messages() const
Get all stored logs.
Definition LogPanel.cpp:30
EditorSink m_sink
Bridges the panel and the log system.
Definition LogPanel.hpp:84
bool m_show_info
Level filter for info.
Definition LogPanel.hpp:94
ImVec2 m_icon_size
Icon size for buttons.
Definition LogPanel.hpp:89
LogPanel() noexcept
Constructor.
Definition LogPanel.cpp:35
void draw() override
Draw config panel.
Definition LogPanel.cpp:49
bool m_show_error
Level filter for error.
Definition LogPanel.hpp:104
bool m_show_warning
Level filter for warning.
Definition LogPanel.hpp:99
Panel() noexcept
Constructor.
Definition Panel.cpp:12
Sink()=default
Constructor.
Application.hpp galaxy.
STL namespace.
Parts of a log message to be passed to sinks.