Skip to content

Instantly share code, notes, and snippets.

@mmmurf
Created September 16, 2008 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmmurf/11104 to your computer and use it in GitHub Desktop.
Save mmmurf/11104 to your computer and use it in GitHub Desktop.
module RiddleLogger
def self.included(base)
base.send :include, InstanceMethods
base.alias_method_chain :query_message, :logging
end
module InstanceMethods
def query_message_with_logging(search, index, comments = '')
returning( query_message_with_logging(search, index, comments ) ) do |message|
::ActiveRecord::Base.logger.info "** Sphinx Query : #{message.inspect}"
end
end
end
end
Riddle::Client.send :include, RiddleLogger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment