From 38f0161aabb302550e1522cb62d19e54d448be9b Mon Sep 17 00:00:00 2001 From: Daniel Guettler Date: Sun, 18 Jul 2010 07:30:48 -0400 Subject: Minor performance improvment in notifications/fanout and active_record/log_subscriber [#5098 state:open] --- activerecord/lib/active_record/log_subscriber.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index 89c79055fe..278e192e59 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -6,6 +6,8 @@ module ActiveRecord end def sql(event) + return unless logger.debug? + name = '%s (%.1fms)' % [event.payload[:name], event.duration] sql = event.payload[:sql].squeeze(' ') -- cgit v1.2.3