Skip to content

Instantly share code, notes, and snippets.

@hynkle
Created September 24, 2010 14:14
Show Gist options
  • Save hynkle/595442 to your computer and use it in GitHub Desktop.
Save hynkle/595442 to your computer and use it in GitHub Desktop.
module ActionController
class Base
private
# For Rails (tested on 2.3.8):
# Displays request parameters hash pretty-printed instead of as an unreadable wall of
# text (but only in development environment).
# Toss this into config/initializers .
# Altered from actionpack-2.3.8/lib/action_controller/base.rb .
def log_processing_for_parameters
parameters = respond_to?(:filter_parameters) ? filter_parameters(params) : params.dup
parameters = parameters.except!(:controller, :action, :format, :_method)
unless parameters.empty?
params_str = Rails.env.development? ? PP.pp(parameters,'') : parameters.inspect
logger.info " Parameters:\n#{params_str}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment