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:
parent
dc2d693014
commit
850aba5473
1 changed files with 5 additions and 3 deletions
|
@ -21,9 +21,11 @@ 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
|
||||
|
|
Loading…
Reference in a new issue