3

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
...
}
Rpj
  • 5,348
  • 16
  • 62
  • 122
  • What are you seeing in your implementation? Show us the code that causes it so we can help you with it. In general, the rails logger has different levels that you can assign to show/hide in different environments. See http://guides.rubyonrails.org/v3.2.13/debugging_rails_applications.html#log-levels – HM1 Aug 08 '13 at 17:26
  • all the output is being spewed to dev, staging, production. I want it only on dev – Rpj Aug 09 '13 at 13:07
  • Please show the code if you want help. Refer to stackoverflow's guidelines for posting questions. – HM1 Aug 09 '13 at 16:36
  • @HM1 Can you answer now – Rpj Aug 10 '13 at 03:53

1 Answers1

6

This might do the trick:

debug_output $stderr if Rails.env.development?
nyzm
  • 2,787
  • 3
  • 24
  • 30