質問

Is it possible to disable logging to debug_output? Or do I have to override a method for a class after I instantiate it? Or something else?

Using the mws gem I see that it extends HTTParty and sets debug_output to $stderr:

In the HTTParty gem I see it has a place for using default options with debug_output:

If I am using the mws gem, which is building a module and class wrapper for HTTParty, how can I override the setting so that my development log isn't filled up by the contents of the debug_output call ?

役に立ちましたか?

解決

It doesnt look like the ruby-mws gem has an API for this, but you should be able to override this in an initializer. Give this a try:

# config/initializers/ruby_mws.rb
class MWS::API::Base
  debug_output nil
end

If you only want this in development you can wrap the code with if Rails.env == 'development'

他のヒント

In development.rb :

MWS::API::Base.debug_output(nil)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top