2026-03-20 17:08:06 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Core/LogEntry.h"
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
|
|
namespace UI {
|
|
|
|
|
|
|
|
|
|
class LogSystem {
|
|
|
|
|
public:
|
|
|
|
|
static LogSystem& Get();
|
|
|
|
|
|
2026-03-20 17:28:06 +08:00
|
|
|
void AddLog(XCEngine::Debug::LogLevel level, const std::string& message);
|
2026-03-20 17:08:06 +08:00
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-20 17:28:06 +08:00
|
|
|
}
|