#pragma once #include #include namespace pddai { class Log { public: enum class Level { Info, Warn, Error }; static void Init(); static void Write(Level level, const std::string& message); static void Info(const std::string& m) { Write(Level::Info, m); } static void Warn(const std::string& m) { Write(Level::Warn, m); } static void Error(const std::string& m) { Write(Level::Error, m); } // 环形缓冲,供 UI 的日志页读取 struct Entry { long long timeMs; Level level; std::string text; }; static std::vector Recent(size_t maxCount = 500); }; }