Sha256: dc26f1fb7d7290f1ee9d69cdbdc6ae9f70604af6ab14dcf6d454379e3d97cb0d

Contents?: true

Size: 443 Bytes

Versions: 11

Compression:

Stored size: 443 Bytes

Contents

class ThinkingSphinx::ActiveRecord::LogSubscriber < ActiveSupport::LogSubscriber
  def query(event)
    identifier = color('Sphinx Query (%.1fms)' % event.duration, GREEN, true)
    debug "  #{identifier}  #{event.payload[:query]}"
  end

  def message(event)
    identifier = color 'Sphinx', GREEN, true
    debug "  #{identifier}  #{event.payload[:message]}"
  end
end

ThinkingSphinx::ActiveRecord::LogSubscriber.attach_to :thinking_sphinx

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
thinking-sphinx-3.1.1 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.1.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.6 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.5 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.4 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.3 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.2 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.1 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.0.rc lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-3.0.0.pre lib/thinking_sphinx/active_record/log_subscriber.rb