aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDaniel Guettler <daniel.guettler@gmail.com>2010-07-18 07:30:48 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-19 11:45:50 -0700
commit38f0161aabb302550e1522cb62d19e54d448be9b (patch)
tree5ae750c5337e155ccea2a8edd47430fa15854364 /activerecord
parentad4ef4226fd5d47252d30effa41a3ab2f55dbc8d (diff)
downloadrails-38f0161aabb302550e1522cb62d19e54d448be9b.tar.gz
rails-38f0161aabb302550e1522cb62d19e54d448be9b.tar.bz2
rails-38f0161aabb302550e1522cb62d19e54d448be9b.zip
Minor performance improvment in notifications/fanout and active_record/log_subscriber [#5098 state:open]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/log_subscriber.rb2
1 files changed, 2 insertions, 0 deletions
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(' ')