api_valve 0.1.0 → 0.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fd0650e0cecef4ec781e6e8a4386ad05573de8b79174d624c7b08af1dfef02bf
|
|
4
|
+
data.tar.gz: a608b1470fdfa950fb23edf5bd05949cff1a3ebf1a89a100994c1f3119999213
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62804cac7016ef7ec069e17ccc229fe25356de1702512de74b425de0a07331464a9067750d0243aa618cdab1100fcc96e05a5095c969e289c567d66adc8d914d
|
|
7
|
+
data.tar.gz: e36dc22f1603317981cf07e372b0deb1a6c65b3ae18b15894a287adb78c7a682e3c90385566e455b7be1dc44d70d8117b6327b31b592d207b7dbc1b3dbd80130
|
|
@@ -8,8 +8,16 @@ module ApiValve
|
|
|
8
8
|
def call(env)
|
|
9
9
|
@app.call(env)
|
|
10
10
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
11
|
+
log_error e
|
|
11
12
|
ErrorResponder.new(e).call
|
|
12
13
|
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def log_error(error)
|
|
18
|
+
ApiValve.logger.error { "#{error.class}: #{error.message}" }
|
|
19
|
+
ApiValve.logger.error { error.backtrace.join("\n") }
|
|
20
|
+
end
|
|
13
21
|
end
|
|
14
22
|
end
|
|
15
23
|
end
|
|
@@ -28,12 +28,12 @@ module ApiValve::Middleware
|
|
|
28
28
|
log_request
|
|
29
29
|
log_url_params
|
|
30
30
|
log_request_headers if Logging.log_request_headers
|
|
31
|
-
log_request_payload if Logging.
|
|
31
|
+
log_request_payload if Logging.log_request_body
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def after_request
|
|
35
35
|
log_response_headers if Logging.log_response_headers
|
|
36
|
-
log_response_payload if Logging.
|
|
36
|
+
log_response_payload if Logging.log_response_body
|
|
37
37
|
log_response
|
|
38
38
|
end
|
|
39
39
|
|
|
@@ -95,7 +95,7 @@ module ApiValve::Middleware
|
|
|
95
95
|
false
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
config_accessor :
|
|
98
|
+
config_accessor :log_request_body do
|
|
99
99
|
false
|
|
100
100
|
end
|
|
101
101
|
|
|
@@ -103,7 +103,7 @@ module ApiValve::Middleware
|
|
|
103
103
|
false
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
-
config_accessor :
|
|
106
|
+
config_accessor :log_response_body do
|
|
107
107
|
false
|
|
108
108
|
end
|
|
109
109
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: api_valve
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mkon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-06-
|
|
11
|
+
date: 2018-06-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|