Skip to content

Commit

Permalink
Merge pull request #918 from muxcmux/fixed-logger-time
Browse files Browse the repository at this point in the history
changed logger output to show seconds instead of milliseconds
  • Loading branch information
DAddYE committed Sep 1, 2012
2 parents 5c6695f + ca72c6a commit b0b128a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions padrino-core/lib/padrino-core/logger.rb
Expand Up @@ -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

Expand Down

0 comments on commit b0b128a

Please sign in to comment.