lib/capistrano/measure/log_reporter.rb in capistrano-measure-0.9.1 vs lib/capistrano/measure/log_reporter.rb in capistrano-measure-0.10.0
- old
+ new
@@ -17,20 +17,31 @@
end
def render(events)
return if events.to_a.empty?
- log_sepertor
- log ColorizedString[" Performance Report"].green
- log_sepertor
+ with_layout do
+ events.each do |event|
+ log "#{'..' * event.indent}#{event.name} #{colorize_time(event.elapsed_time)}"
+ end
+ end
+ end
- events.each do |event|
- log "#{'..' * event.indent}#{event.name} #{colorize_time(event.elapsed_time)}"
+ def render_error(message)
+ with_layout do
+ @logger.error message
end
- log_sepertor
end
private
+
+ def with_layout
+ log_sepertor
+ log ColorizedString[" Performance Report"].green
+ log_sepertor
+ yield
+ log_sepertor
+ end
def log_sepertor
log "=" * 60
end