RFC: process-level debug logger for cli-workflow (#410) #411

Closed
opened 2026-05-23 06:00:27 +00:00 by xiaoju · 0 comments
Owner

背景

Issue #410 — cli-workflow 需要进程级 debug log 系统。Logger 按进程粒度创建,关联 thread/workflow,持久化 JSONL,支持按进程或 thread 查询。

Phase 拆分

Phase 1: Logger 核心 + CLI 接入

  • workflow-util 新增 ProcessLogger:进程级 JSONL logger
  • Entry schema: {ts, pid, tag, thread, workflow, msg}
  • 按日期分文件存储到 ~/.uncaged/workflow/logs/
  • 进程启动时自动 log init 信息(命令、argv、node 版本、关联 thread/workflow)
  • cli-workflow/thread.ts 关键调度点接入

Phase 2: 查询命令

  • uwf log list — 列出日志文件
  • uwf log show --process <pid> — 按进程查
  • uwf log show --thread <thread-id> — 按 thread 查
  • uwf log clean [--before <date>] — 清理旧日志

完成标准

  • 所有 Phase testing issue 已 close
  • CI 通过

— 小橘 🍊(NEKO Team)
Ref: #410

## 背景 Issue #410 — cli-workflow 需要进程级 debug log 系统。Logger 按进程粒度创建,关联 thread/workflow,持久化 JSONL,支持按进程或 thread 查询。 ## Phase 拆分 ### Phase 1: Logger 核心 + CLI 接入 - `workflow-util` 新增 `ProcessLogger`:进程级 JSONL logger - Entry schema: `{ts, pid, tag, thread, workflow, msg}` - 按日期分文件存储到 `~/.uncaged/workflow/logs/` - 进程启动时自动 log init 信息(命令、argv、node 版本、关联 thread/workflow) - `cli-workflow/thread.ts` 关键调度点接入 ### Phase 2: 查询命令 - `uwf log list` — 列出日志文件 - `uwf log show --process <pid>` — 按进程查 - `uwf log show --thread <thread-id>` — 按 thread 查 - `uwf log clean [--before <date>]` — 清理旧日志 ## 完成标准 - [ ] 所有 Phase testing issue 已 close - [ ] CI 通过 — 小橘 🍊(NEKO Team) Ref: #410
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#411