feat(m188): launcher.log 早落盘 + 会话日志搬到 logs/game(旧家只读兼容)
用户投诉原话:「我们的启动日志放在哪?…他找半天没找到崩溃日志」「只有一个安装日志」。 启动器运行日志(.ULL/logs/launcher.log) - presenter 构造 HostEnv 时就登记日志目录:启动早期缓冲的 200 行([probe]/[font]/[theme]) 当场刷盘,不再是「只有开过一局游戏才有日志」。 - app/** 里所有 eprintln! 诊断改走 app::diag::diag!(stderr + 文件双写,行首 [tag] 即 scope), 含 boot/boot::fallback/state/update 各线。 - boot 那一拍补一行后端事实(request/effective/fallback)。 - 滚动上限(1 MiB → launcher.1.log,只留一份)写进 README 与 docs/logs-location.md。 会话日志搬家:data/agent/sessions → logs - LauncherLayout: sessions_root()/game_logs() 新增,agent_sessions() 降级为只读兼容。 - host/logs 与 cli/commands/sessions 两个根合并(同 id 新根优先),event_path 回落旧家。 - 不搬不删;日志目录写一份 session-log-location.json 记录(moved=0, policy=read-only-compat)。 入口与文案 - 设置页「通用」新增「日志文件夹」行:路径 + 打开目录 + 复制路径(i18n 中英)。 - 日志页页头的「打开目录」不再是占位:走 M187 的 open_dir,失败文本带路径并送进剪贴板。 - README.md / README.zh-CN.md 新增「日志在哪」章节(含 crash-reports 只在游戏走到那一步才有), docs/logs-location.md 给出上限、双写判据、迁移策略与没验的部分。 守门(每条都有变异证明,见报告) - 旧家会话仍列得出/打不开 ⇒ 只读新根变红;新会话写 logs/game ⇒ 只读旧根、写回旧家都变红。 - launcher.log 滚动 ⇒ 干掉 rename 变红。 - 打开日志文件夹指向真实目录 ⇒ 换成 cache/ 或去掉 create_dir_all 都变红。 - 日志根随三模式变化 ⇒ 把 HostEnv::logs_dir 写死成便携落点变红。
This commit is contained in:
1 parent
efc663a3cb
commit
5fd5cd47dc
47 files changed
+1371
-119
No files matched your search
@@ -168,12 +168,24 @@ impl Ctx {
|
||||
self.layout().profiles_config()
|
||||
}
|
||||
|
||||
/// 会话根(`<data>/agent/sessions`,launch 的事件流与索引都在这下面)。
|
||||
/// 会话根(M188 起 = `<data>/logs`;launch 的事件流与索引都在这下面)。
|
||||
#[must_use]
|
||||
pub fn sessions_root(&self) -> PathBuf {
|
||||
self.layout().sessions_root()
|
||||
}
|
||||
|
||||
/// 会话日志的**旧家**(`<data>/data/agent/sessions`):只读兼容,M188 起不再往里写。
|
||||
#[must_use]
|
||||
pub fn legacy_sessions_root(&self) -> PathBuf {
|
||||
self.layout().agent_sessions()
|
||||
}
|
||||
|
||||
/// 启动器日志目录(`<data>/logs`:`launcher.log` + `game/` 会话)。
|
||||
#[must_use]
|
||||
pub fn logs_dir(&self) -> PathBuf {
|
||||
self.layout().logs()
|
||||
}
|
||||
|
||||
/// 账户数据目录(`data/auth/`:`accounts.json` + `credentials.dat`)。
|
||||
#[must_use]
|
||||
pub fn auth_data(&self) -> PathBuf {
|
||||
@@ -186,6 +198,12 @@ impl Ctx {
|
||||
unlucky_core::launch::session_index::index_path(&self.sessions_root())
|
||||
}
|
||||
|
||||
/// 旧家的会话索引(`data/agent/sessions/game/index.jsonl`):只读兼容。
|
||||
#[must_use]
|
||||
pub fn legacy_session_index(&self) -> PathBuf {
|
||||
unlucky_core::launch::session_index::index_path(&self.legacy_sessions_root())
|
||||
}
|
||||
|
||||
/// D19/D21:低于基线(Win10+ / macOS 12+ / Linux 达标)时拒绝执行。
|
||||
///
|
||||
/// # Errors
|
||||
|
||||
Reference in new issue
Block a user