Sha256: cb37dbfd9f7a143ee0525ea67c947aaf1fbccb6e9061efcca3928790e99a8647

Contents?: true

Size: 726 Bytes

Versions: 16

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::ActiveRecord::LogSubscriber < ActiveSupport::LogSubscriber
  def guard(event)
    identifier = color 'Sphinx', GREEN, true
    warn "  #{identifier}  #{event.payload[:guard]}"
  end

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

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

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

ThinkingSphinx::ActiveRecord::LogSubscriber.attach_to :thinking_sphinx

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
thinking-sphinx-5.5.1 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/active_record/log_subscriber.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/active_record/log_subscriber.rb