lib/finapps/middleware/response_logger.rb in finapps-1.0.6 vs lib/finapps/middleware/response_logger.rb in finapps-1.0.7
- old
+ new
@@ -3,19 +3,19 @@
class ResponseLogger < Faraday::Response::Middleware
include FinApps::Logging
def call(env)
- logger.info "##{__method__.to_s} => ##{env.method} #{env.url.to_s}"
- logger.debug "##{__method__.to_s} => Request Headers: #{dump_headers env.request_headers}"
+ logger.info "##{__method__} => ##{env.method} #{env.url.to_s}"
+ logger.debug "##{__method__} => Request Headers: #{dump_headers env.request_headers}"
super
end
def on_complete(env)
- logger.info "##{__method__.to_s} => ##{env.method} #{env.url.to_s}"
- logger.debug "##{__method__.to_s} => Response Headers: #{dump_headers env.response_headers}"
- logger.info "##{__method__.to_s} => Response Body: #{env.body}" if env.body
+ logger.info "##{__method__} => ##{env.method} #{env.url.to_s}"
+ logger.debug "##{__method__} => Response Headers: #{dump_headers env.response_headers}"
+ logger.info "##{__method__} => Response Body: #{env.body}" if env.body
end
private
def dump_headers(headers)
headers.map { |k, v| " #{k}: #{filter_sensitive_header_values(k,v)}" }.to_s