1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed that BenchmarkHelper should use controller.logger instead of @logger (which now apparently is gone)

This commit is contained in:
David Heinemeier Hansson 2008-04-27 22:46:19 -05:00
parent dc2d693014
commit 850aba5473

View file

@ -21,11 +21,13 @@ module ActionView
# 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