Class: ThinkingSphinx::ActiveRecord::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/log_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#caution(event) ⇒ Object



19
20
21
22
# File 'lib/thinking_sphinx/active_record/log_subscriber.rb', line 19

def caution(event)
  identifier = colored_text "Sphinx"
  warn "  #{identifier}  #{event.payload[:caution]}"
end

#guard(event) ⇒ Object



4
5
6
7
# File 'lib/thinking_sphinx/active_record/log_subscriber.rb', line 4

def guard(event)
  identifier = colored_text "Sphinx"
  warn "  #{identifier}  #{event.payload[:guard]}"
end

#message(event) ⇒ Object



9
10
11
12
# File 'lib/thinking_sphinx/active_record/log_subscriber.rb', line 9

def message(event)
  identifier = colored_text "Sphinx"
  debug "  #{identifier}  #{event.payload[:message]}"
end

#query(event) ⇒ Object



14
15
16
17
# File 'lib/thinking_sphinx/active_record/log_subscriber.rb', line 14

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