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
travis-ci/gh:.travis.yml@a495d43
language: ruby
dist: bionic
rvm:
  - 2.3.8
  - 2.4.10
  - 2.5.8
  - 2.6.6
  - 2.7.0
  - jruby-9.1
  - jruby-9.2
  - jruby-head
before_install:
  - gem update bundler
matrix:
  allow_failures:
    - rvm: 2.7.0
    - rvm: jruby-head
Build Config
{
  "language": "ruby",
  "os": [
    "linux"
  ],
  "dist": "bionic",
  "rvm": [
    "2.3.8",
    "2.4.10",
    "2.5.8",
    "2.6.6",
    "2.7.0",
    "jruby-9.1",
    "jruby-9.2",
    "jruby-head"
  ],
  "before_install": [
    "gem update bundler"
  ],
  "jobs": {
    "allow_failures": [
      {
        "rvm": "2.7.0"
      },
      {
        "rvm": "jruby-head"
      }
    ]
  }
}