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 = color 'Sphinx', GREEN, true
  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 = color 'Sphinx', GREEN, true
  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 = color 'Sphinx', GREEN, true
  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 = color('Sphinx Query (%.1fms)' % event.duration, GREEN, true)
  debug "  #{identifier}  #{event.payload[:query]}"
end