Skip to content

Commit

Permalink
Fixed that BenchmarkHelper should use controller.logger instead of @l…
Browse files Browse the repository at this point in the history
…ogger (which now apparently is gone)
  • Loading branch information
David Heinemeier Hansson committed Apr 28, 2008
1 parent dc2d693 commit 850aba5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions actionpack/lib/action_view/helpers/benchmark_helper.rb
Expand Up @@ -21,11 +21,13 @@ module BenchmarkHelper
# You may give an optional logger level as the second argument
# (:debug, :info, :warn, :error); the default value is :info.
def benchmark(message = "Benchmarking", level = :info)
if @logger
if controller.logger
real = Benchmark.realtime { yield }
@logger.send level, "#{message} (#{'%.5f' % real})"
controller.logger.send level, "#{message} (#{'%.5f' % real})"
else
yield
end
end
end
end
end
end

0 comments on commit 850aba5

Please sign in to comment.