lib/footrest/connection.rb in footrest-0.3.1 vs lib/footrest/connection.rb in footrest-0.4.1
- old
+ new
@@ -8,13 +8,18 @@
module Connection
attr_reader :connection
def set_connection(config)
+ config[:logger] = config[:logging] if config[:logging]
@connection = Faraday.new(url: config[:prefix]) do |faraday|
faraday.request :multipart
faraday.request :url_encoded
- faraday.response :logger if config[:logging]
+ if config[:logger] == true
+ faraday.response :logger
+ elsif config[:logger]
+ faraday.use Faraday::Response::Logger, config[:logger]
+ end
faraday.adapter Faraday.default_adapter
faraday.use Footrest::FollowRedirects
faraday.use Footrest::ParseJson, :content_type => /\bjson$/
faraday.use Footrest::RaiseFootrestErrors
faraday.use Footrest::Pagination
\ No newline at end of file