http://www.ruby-doc.org/gems/docs/b/bartzon-httparty-0.6.1/HTTParty/ClassMethods.html#method-i-debug_output

How should I control the HTTParty output using a rails logger? I don't want to see this on the staging or prod environment.

class FooResource
   include HTTParty
   persistent_connection_adapter
   debug_output $stderr
...
}
有帮助吗?

解决方案

This might do the trick:

debug_output $stderr if Rails.env.development?
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top