diff --git a/lib/savon/request.rb b/lib/savon/request.rb index 5197019e..7f330bf3 100644 --- a/lib/savon/request.rb +++ b/lib/savon/request.rb @@ -77,7 +77,7 @@ def configure_adapter end def configure_logging - connection.response(:logger, nil, headers: @globals[:log_headers], level: @globals[:logger].level) if @globals[:log] + connection.response(:logger, @globals[:logger], headers: @globals[:log_headers]) if @globals[:log] end protected diff --git a/spec/savon/options_spec.rb b/spec/savon/options_spec.rb index 5049b1a6..41db9c31 100644 --- a/spec/savon/options_spec.rb +++ b/spec/savon/options_spec.rb @@ -331,7 +331,7 @@ def to_s end it "silences Faraday as well" do - Faraday::Connection.any_instance.expects(:response).with(:logger, nil, {:headers => true, :level => 0}).never + Faraday::Connection.any_instance.expects(:response).never new_client(:log => false) end @@ -346,7 +346,7 @@ def to_s end it "turns Faraday logging back on as well" do - Faraday::Connection.any_instance.expects(:response).with(:logger, nil, {:headers => true, :level => 0}).at_least_once + Faraday::Connection.any_instance.expects(:response).with(:logger, kind_of(Logger), {:headers => true}).at_least_once new_client(:log => true) end end @@ -367,10 +367,10 @@ def to_s end it "sets the logger of faraday connection as well" do - Faraday::Connection.any_instance.expects(:response).with(:logger, nil, {:headers => true, :level => 0}).at_least_once + custom_logger = Logger.new($stdout) + custom_logger.level = :fatal + Faraday::Connection.any_instance.expects(:response).with(:logger, custom_logger, {:headers => true}).at_least_once mock_stdout { - custom_logger = Logger.new($stdout) - client = new_client(:endpoint => @server.url, :logger => custom_logger, :log => true) client.call(:authenticate) }