How to approach adding logging timestamps
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- ruby
- 领域
- build-system, cli
调研方向
首先检查整个 Rake 代码库和 Rakefiles 中的输出处理,尤其是对 Kernel.puts 的直接使用,以及拟议的 STDOUT/STDERR 包装方案。确定可选启用的时间戳功能是否能够保留库的行为;在实现之前就可行的设计和明确的范围达成一致,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Hello,
our customer would like to have optional timestamps for rake output and I would like to contribute this feature if this is feasible. I did some research and it looks like both Rake codebase and Rakefiles use "Kernel.puts" directly. So I have two ideas I would like to discuss before I do any coding:
-
Hacky approach: create STDOUT/STDERR wrappers and change
$stdoutand$stderrglobal variables to these instances. They would add timestamps when configured. Pros: Safe for the future changes because nothing is changing in the codebase. Cons: When Rake is used as a library, changing standard output and error would introduce regressions and problems after upgrade. -
Clean but disturbing approach: search and replace
putsin the codebase and create a DSL methodputsfor use in Rakefiles. This looks cleaner, but developers are already used toputsin the codebase. Everytime new line withputsis added, the output will appear in the output without timestamp. Since this feature would be opt-in, devs will start adding these types kinds of errors pretty soon.
Honestly, I am not sure if I can deliver this feature to my customer but let's discuss and see what you guys think about this. Cheers!
- 主要语言
- Ruby
- 星标
- 2.5k
- 派生
- 650
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/rake 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 28/100
-
难度 1/5 1 小时以内 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 38/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
バグ
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 75/100
voxpupuli/puppet-epel#186 · 1 条评论 ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) 未关闭Bug Frontend
难度 2/5 1-3 小时 新手友好度 78/100