faraday 2.7.9 → 2.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/faraday/logging/formatter.rb +9 -15
- data/lib/faraday/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4aa57af93476ba31117b14ed37bea950bf9b677d4dcca13ca1296a3ac2c3ff7
|
4
|
+
data.tar.gz: 98b3cb7b7c5c08eba9f58ad96181757d6cd7fc7431ac47ae19e8c95a25de12f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28f98f568e844799353a00d5ff49511f7bdb759a50edd3de2d4194fbb348dc14d1ef0294d854016ccdcbec915546225ebb2cf6dec354d6e7fbbf707b00cfc170
|
7
|
+
data.tar.gz: 3506cebb9ad1fbd1dd38c1804e18cfd7d7352796d11fa564cde9ce0eee1b1a8ba6d07acda4b179662e5b6eb23baf6f70173240cf8a6b69834d2db9c740a80e25
|
@@ -13,25 +13,26 @@ module Faraday
|
|
13
13
|
|
14
14
|
def initialize(logger:, options:)
|
15
15
|
@logger = logger
|
16
|
-
@filter = []
|
17
16
|
@options = DEFAULT_OPTIONS.merge(options)
|
17
|
+
unless %i[debug info warn error fatal].include?(@options[:log_level])
|
18
|
+
@options[:log_level] = :info
|
19
|
+
end
|
20
|
+
@filter = []
|
18
21
|
end
|
19
22
|
|
20
23
|
def_delegators :@logger, :debug, :info, :warn, :error, :fatal
|
21
24
|
|
22
25
|
def request(env)
|
23
|
-
|
26
|
+
public_send(log_level, 'request') do
|
24
27
|
"#{env.method.upcase} #{apply_filters(env.url.to_s)}"
|
25
28
|
end
|
26
|
-
public_send(log_level, 'request', &request_log)
|
27
29
|
|
28
30
|
log_headers('request', env.request_headers) if log_headers?(:request)
|
29
31
|
log_body('request', env[:body]) if env[:body] && log_body?(:request)
|
30
32
|
end
|
31
33
|
|
32
34
|
def response(env)
|
33
|
-
|
34
|
-
public_send(log_level, 'response', &status)
|
35
|
+
public_send(log_level, 'response') { "Status #{env.status}" }
|
35
36
|
|
36
37
|
log_headers('response', env.response_headers) if log_headers?(:response)
|
37
38
|
log_body('response', env[:body]) if env[:body] && log_body?(:response)
|
@@ -40,8 +41,7 @@ module Faraday
|
|
40
41
|
def exception(exc)
|
41
42
|
return unless log_errors?
|
42
43
|
|
43
|
-
|
44
|
-
public_send(log_level, 'error', &error_log)
|
44
|
+
public_send(log_level, 'error') { exc.full_message }
|
45
45
|
|
46
46
|
log_headers('error', exc.response_headers) if exc.respond_to?(:response_headers) && log_headers?(:error)
|
47
47
|
return unless exc.respond_to?(:response_body) && exc.response_body && log_body?(:error)
|
@@ -103,21 +103,15 @@ module Faraday
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def log_level
|
106
|
-
unless %i[debug info warn error fatal].include?(@options[:log_level])
|
107
|
-
return :info
|
108
|
-
end
|
109
|
-
|
110
106
|
@options[:log_level]
|
111
107
|
end
|
112
108
|
|
113
109
|
def log_headers(type, headers)
|
114
|
-
|
115
|
-
public_send(log_level, type, &headers_log)
|
110
|
+
public_send(log_level, type) { apply_filters(dump_headers(headers)) }
|
116
111
|
end
|
117
112
|
|
118
113
|
def log_body(type, body)
|
119
|
-
|
120
|
-
public_send(log_level, type, &body_log)
|
114
|
+
public_send(log_level, type) { apply_filters(dump_body(body)) }
|
121
115
|
end
|
122
116
|
end
|
123
117
|
end
|
data/lib/faraday/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@technoweenie"
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-06
|
13
|
+
date: 2023-07-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday-net_http
|
@@ -131,7 +131,7 @@ licenses:
|
|
131
131
|
- MIT
|
132
132
|
metadata:
|
133
133
|
homepage_uri: https://lostisland.github.io/faraday
|
134
|
-
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.7.
|
134
|
+
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.7.10
|
135
135
|
source_code_uri: https://github.com/lostisland/faraday
|
136
136
|
bug_tracker_uri: https://github.com/lostisland/faraday/issues
|
137
137
|
post_install_message:
|