法拉第默认不记录任何内容:
irb(main):001:0> require "faraday"
=> true
irb(main):002:0> Faraday.get 'http://sushi.com/nigiri/sake.json'
=> #<Faraday::Response:0x007ff48f0422a8 @env={:method=>:get, :body=>"", :url=>#<URI::HTTP:0x007ff48f03bd40 URL:http://sushi.com/nigiri/sake.json>, :request_headers=>{"User-Agent"=>"Faraday v0.8.7"}, :parallel_manager=>nil, :request=>{:proxy=>nil}, :ssl=>{}, :status=>302, :response_headers=>{"date"=>"Thu, 25 Jul 2013 14:36:42 GMT", "server"=>"Apache/2.2.22 (Ubuntu)", "x-powered-by"=>"PHP/5.3.10-1ubuntu3.6", "location"=>"http://sushi.com/?f", "vary"=>"Accept-Encoding", "content-length"=>"20", "connection"=>"close", "content-type"=>"text/html", "set-cookie"=>"WEBUK=WUK08; path=/"}, :response=>#<Faraday::Response:0x007ff48f0422a8 ...>}, @on_complete_callbacks=[]>
我假设您的应用程序中有一些配置块,如下所示:
conn = Faraday.new(:url => 'http://sushi.com') do |faraday|
faraday.request :url_encoded
faraday.response :logger
faraday.adapter Faraday.default_adapter
end
conn.get '/nigiri/sake.json'
如果删除该logger
行,则不应有任何输出到 STDOUT。