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