Switch to WebView2 host with embedded resources, save chat images by order, and support buyer photo replace/delete via rules, dHash matching, and optional model-assisted intent parsing.
29 lines
651 B
C++
29 lines
651 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
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<Entry> Recent(size_t maxCount = 500);
|
|
};
|
|
|
|
}
|