DEV: Improve logging and fix some formatting errors (#92)
This commit is contained in:
parent
92e3b2e4b2
commit
576ccb6304
12
plugin.rb
12
plugin.rb
|
@ -50,7 +50,7 @@ require "faraday/logging/formatter"
|
||||||
class OAuth2FaradayFormatter < Faraday::Logging::Formatter
|
class OAuth2FaradayFormatter < Faraday::Logging::Formatter
|
||||||
def request(env)
|
def request(env)
|
||||||
warn <<~LOG
|
warn <<~LOG
|
||||||
OAuth2 Debugging: request #{env.method.upcase} #{env.url.to_s}
|
OAuth2 Debugging: request #{env.method.upcase} #{env.url}
|
||||||
|
|
||||||
Headers:
|
Headers:
|
||||||
#{env.request_headers.to_yaml}
|
#{env.request_headers.to_yaml}
|
||||||
|
@ -64,7 +64,7 @@ class OAuth2FaradayFormatter < Faraday::Logging::Formatter
|
||||||
warn <<~LOG
|
warn <<~LOG
|
||||||
OAuth2 Debugging: response status #{env.status}
|
OAuth2 Debugging: response status #{env.status}
|
||||||
|
|
||||||
From #{env.method.upcase} #{env.url.to_s}
|
From #{env.method.upcase} #{env.url}
|
||||||
|
|
||||||
Headers:
|
Headers:
|
||||||
#{env.request_headers.to_yaml}
|
#{env.request_headers.to_yaml}
|
||||||
|
@ -236,8 +236,12 @@ class ::OAuth2BasicAuthenticator < Auth::ManagedAuthenticator
|
||||||
log <<-LOG
|
log <<-LOG
|
||||||
user_json request: #{user_json_method} #{user_json_url}
|
user_json request: #{user_json_method} #{user_json_url}
|
||||||
|
|
||||||
response:
|
request headers: #{headers}
|
||||||
#{user_json_response.to_yaml}
|
|
||||||
|
response status: #{user_json_response.status}
|
||||||
|
|
||||||
|
response body:
|
||||||
|
#{user_json_response.body}
|
||||||
LOG
|
LOG
|
||||||
|
|
||||||
if user_json_response.status == 200
|
if user_json_response.status == 200
|
||||||
|
|
Loading…
Reference in New Issue