添加ui_editor编辑器模块初始代码
This commit is contained in:
26
ui_editor/src/Managers/LogSystem.h
Normal file
26
ui_editor/src/Managers/LogSystem.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "Core/LogEntry.h"
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
namespace UI {
|
||||
|
||||
class LogSystem {
|
||||
public:
|
||||
static LogSystem& Get();
|
||||
|
||||
void AddLog(LogEntry::Level level, const std::string& message);
|
||||
void Clear();
|
||||
const std::vector<LogEntry>& GetLogs() const { return m_logs; }
|
||||
|
||||
void SetCallback(std::function<void()> callback) { m_callback = callback; }
|
||||
|
||||
private:
|
||||
LogSystem() = default;
|
||||
|
||||
std::vector<LogEntry> m_logs;
|
||||
std::function<void()> m_callback;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user