Class: CouchRestModelSearchLogger

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/couchrest_model_search.rb

Overview

see gist.github.com/566725 on how to use ActiveSupport logging

Instance Method Summary collapse

Instance Method Details

#search(event) ⇒ Object



138
139
140
141
142
# File 'lib/couchrest_model_search.rb', line 138

def search(event)
  name = '%s (%.1fms)' % ["Couchdb-lucene Query", event.duration]
  url = event.payload[:query]
  info "  #{color(name, YELLOW, true)}  [ #{url} ]"
end