You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 $stdout and $stderr global 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 puts in the codebase and create a DSL method puts for use in Rakefiles. This looks cleaner, but developers are already used to puts in the codebase. Everytime new line with puts is 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!
The text was updated successfully, but these errors were encountered:
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
$stdout
and$stderr
global 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
puts
in the codebase and create a DSL methodputs
for use in Rakefiles. This looks cleaner, but developers are already used toputs
in the codebase. Everytime new line withputs
is 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!
The text was updated successfully, but these errors were encountered: