class RestClient::Request

Public Instance Methods

log_request() click to toggle source
# File lib/morpheus/ext/rest_client.rb, line 9
def log_request
  begin
    return unless RestClient.log
    out = []
    # out << "RestClient.#{method} #{redacted_url.inspect}"
    out << "#{method.to_s.upcase} #{redacted_url.inspect}"
    out << payload.short_inspect if payload
    out << processed_headers.to_a.sort.map { |(k, v)| [k.inspect, v.inspect].join("=>") }.join(", ")
    RestClient.log << out.join(', ') + "\n"
  rescue
    # something went wrong, wrong gem version maybe...above is from rest-client 2.0.2
    # do it the old way
    original_log_request()
  end
end
Also aliased as: original_log_request
original_log_request()
Alias for: log_request