Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ImguiEditorLog.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <Common/Log/logger_fwd.h>
6#include <Common/primitive_type.h>
7
8#include <string>
9#include <string_view>
10#include <vector>
11
12namespace ph::editor
13{
14
16{
17public:
18 explicit ImguiEditorLog(ImguiEditorUIProxy editorUI);
19
20 void buildWindow(const char* windowIdName, bool* isOpening) override;
21 auto getAttributes() const -> Attributes override;
22
23 static void engineLogHook(ELogLevel logLevel, std::string_view logString);
24
25private:
26 struct LogMessage
27 {
28 std::string text;
29 ELogLevel level;
30 // TODO: passed filter?
31 };
32
33 void retrieveNewLogs();
34 void clearLogs();
35
36 // TODO: filter 1: combobox for log level (toggle)
37 // TODO: filter 2: word filter
38
39 static bool tryRetrieveOneLog(LogMessage* out_message);
40
41 std::vector<LogMessage> m_logBuffer;
42 std::size_t m_numLogs;
43 std::size_t m_numClearedLogs;
44 bool m_isAutoScrollEnabled;
45};
46
47}// end namespace ph::editor
Definition ImguiEditorLog.h:16
void buildWindow(const char *windowIdName, bool *isOpening) override
Definition ImguiEditorLog.cpp:60
static void engineLogHook(ELogLevel logLevel, std::string_view logString)
Definition ImguiEditorLog.cpp:193
ImguiEditorLog(ImguiEditorUIProxy editorUI)
Definition ImguiEditorLog.cpp:41
auto getAttributes() const -> Attributes override
Definition ImguiEditorLog.cpp:131
Definition ImguiEditorPanel.h:29
Definition ImguiEditorUIProxy.h:16
Definition ph_editor.h:10
Definition ImguiEditorPanel.h:32