refactor: config 路径自动检测 + 日志规范化 + me flag 过滤#36
Conversation
- 新增 defaultLogDir() 通过 go.mod 自动定位项目根目录,消除硬编码相对路径 - WALPath/SSTablePath 使用自动检测的 log 目录 - 新增 meFlagArgs() 过滤命令行参数,仅传递 -me 相关参数给 flag 解析 - 日志规范化:使用结构化 slog 格式,去除冗余标签前缀 - 无效 me 值时用 panic 替代 os.Exit,更易于调试 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR refactors global configuration initialization and CLI argument parsing in ChangesConfiguration and CLI updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
defaultLogDir()— 从当前目录向上查找go.mod来定位项目根目录,自动推导log/路径WALPath/SSTablePath改为基于自动检测的目录,不再硬编码../../../logmeFlagArgs()— 从os.Args中仅提取-me/-me=...参数,避免未定义 flag 报错[INFO]等冗余前缀)ParseFlags中无效me值改为panic(替代os.Exit),便于定位调用栈🤖 Generated with Claude Code
Summary by CodeRabbit