Skip to content
Browse files

Fixed that BenchmarkHelper should use controller.logger instead of @l…

…ogger (which now apparently is gone)
  • Loading branch information...
1 parent dc2d693 commit 850aba5473ce14edcd067f16badfa198e2070095 David Heinemeier Hansson committed Apr 27, 2008
Showing with 5 additions and 3 deletions.
  1. +5 −3 actionpack/lib/action_view/helpers/benchmark_helper.rb
View
8 actionpack/lib/action_view/helpers/benchmark_helper.rb
@@ -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.
Something went wrong with that request. Please try again.