Class: Auth::OauthFaradayFormatter

Inherits:
Faraday::Logging::Formatter
  • Object
show all
Defined in:
lib/auth/oauth_faraday_formatter.rb

Instance Method Summary collapse

Instance Method Details

#request(env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/auth/oauth_faraday_formatter.rb', line 4

def request(env)
  warn <<~LOG
    OAuth Debugging: request #{env.method.upcase} #{env.url}

    Headers:
    #{env.request_headers}

    Body:
    #{env[:body]}
  LOG
end

#response(env) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/auth/oauth_faraday_formatter.rb', line 16

def response(env)
  warn <<~LOG
    OAuth Debugging: response status #{env.status}

    From #{env.method.upcase} #{env.url}

    Headers:
    #{env.response_headers}

    Body:
    #{env[:body]}
  LOG
end