Skip to content

Commit 555a54e

Browse files
committed
Prepend each line with timestamp to make it easier to see where the
bottlenecks are.
1 parent 8a8fa54 commit 555a54e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rake/formatter.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ def inject_headers(command, lines, spaces=2)
8787

8888
def command_headers(command)
8989
ShellOut::HEADERS_LIST.inject('') do |result, k|
90+
now = Time.new
9091
color = command.failure? ? [:red, :bold] : Array(ShellOut::HEADERS_COLORS[k])
9192
header = send(:"header_#{k}", command) if respond_to?(:"header_#{k}", true)
92-
header ? result << '[%s]' % colorize(header, *color) : result
93+
hours, minutes, seconds, _ = Date.day_fraction_to_time(now)
94+
header ? result << '[%s] %s:%s:%s' % [colorize(header, *color), hours, minutes, seconds] : result
9395
end
9496
end
9597

0 commit comments

Comments
 (0)