Permalink
Browse files

changed logger output to show seconds instead of milliseconds

  • Loading branch information...
muxcmux committed Aug 23, 2012
1 parent 777aa75 commit ca72c6ae395bbd91d28bd1bec9ecfae59b3d8171
Showing with 2 additions and 2 deletions.
  1. +2 −2 padrino-core/lib/padrino-core/logger.rb
@@ -93,15 +93,15 @@ module Extensions
#
# @example
# logger.bench 'GET', started_at, '/blog/categories'
# # => DEBUG - GET (0.056ms) - /blog/categories
# # => DEBUG - GET (0.0056s) - /blog/categories
#
def bench(action, began_at, message, level=:debug, color=:yellow)
@_pad ||= 8
@_pad = action.to_s.size if action.to_s.size > @_pad
duration = Time.now - began_at
color = :red if duration > 1
action = colorize(action.to_s.upcase.rjust(@_pad), color)
duration = colorize('%0.4fms' % duration, :bold, color)
duration = colorize('%0.4fs' % duration, :bold, color)
push "#{action} (#{duration}) #{message}", level
end

0 comments on commit ca72c6a

Please sign in to comment.