Pull Request #44 Customize Faraday logger formatter

In particular, add the ability to log `X-*` response headers. GitHub
provides useful information such as `x-github-request-id`. With this
option, we get the following logs:

[1] pry(main)> require 'gh'
=> true
[2] pry(main)> GH.set :formatter => 'response_x_header_formatter'
=> {:formatter=>"response_x_header_formatter"}
[3] pry(main)> GH.head '/'
I, [2020-06-24T17:27:02.309042 #15465] INFO -- Response: {"x-content-type-options"=>"nosniff", "x-frame-options"=>"deny", "x-github-media-type"=>"github.v3; format=json", "x-github-request-id"=>"F786:7114:AF4F41:12EC65F:5EF3C526", "x-ratelimit-limit"=>"60", "x-ratelimit-remaining"=>"58", "x-ratelimit-reset"=>"1593037573", "x-xss-protection"=>"1; mode=block"}
=> {"_links"=>{"self"=>{"href"=>"https://api.github.com/"}}}

Hiro Asari avatar Hiro Asari

Pull request event #330 passed

  • Ran for
  • Total time
  • New branch build