diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-05-28 22:58:45 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-28 22:58:45 +0100 |
commit | 4d248543429918bc5a63e109e6f2327ffab9848b (patch) | |
tree | 5506aa754aa64a8fcf7e7ddca0a3e85b590f9d38 /activerecord/lib | |
parent | c2fbcba16d2349285368c86b849db946dc0e7d57 (diff) | |
download | rails-4d248543429918bc5a63e109e6f2327ffab9848b.tar.gz rails-4d248543429918bc5a63e109e6f2327ffab9848b.tar.bz2 rails-4d248543429918bc5a63e109e6f2327ffab9848b.zip |
Ensure correct db time is reported in production logs.
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 8c286f64db..f48b107a2a 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -128,15 +128,11 @@ module ActiveRecord 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 |