Created
September 16, 2008 19:05
-
-
Save mmmurf/11104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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