Permalink
Browse files

Ensure correct db time is reported in production logs.

  • Loading branch information...
1 parent c2fbcba commit 4d248543429918bc5a63e109e6f2327ffab9848b @lifo lifo committed May 28, 2008
Showing with 5 additions and 9 deletions.
  1. +5 −9 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -128,15 +128,11 @@ def log_info(sql, name, runtime)
protected
def log(sql, name)
if block_given?
- if @logger and @logger.debug?
- result = nil
- seconds = Benchmark.realtime { result = yield }
- @runtime += seconds
- log_info(sql, name, seconds)
- result
- else
- yield
- end
+ result = nil
+ seconds = Benchmark.realtime { result = yield }
+ @runtime += seconds
+ log_info(sql, name, seconds)
+ result
else
log_info(sql, name, 0)
nil

0 comments on commit 4d24854

Please sign in to comment.