Methods
Class Public methods
Instance Public methods
# File activerecord/lib/active_record/log_subscriber.rb, line 49 def identity(event) return unless logger.debug? name = color(event.payload[:name], odd? ? CYAN : MAGENTA, true) line = odd? ? color(event.payload[:line], nil, true) : event.payload[:line] debug " #{name} #{line}" end
# File activerecord/lib/active_record/log_subscriber.rb, line 21 def sql(event) self.class.runtime += event.duration return unless logger.debug? payload = event.payload return if 'SCHEMA' == payload[:name] name = '%s (%.1fms)' % [payload[:name], event.duration] sql = payload[:sql].squeeze(' ') binds = nil unless (payload[:binds] || []).empty? binds = " " + payload[:binds].map { |col,v| [col.name, v] }.inspect end if odd? name = color(name, CYAN, true) sql = color(sql, nil, true) else name = color(name, MAGENTA, true) end debug " #{name} #{sql}#{binds}" end