log_sanity 2.4.0 → 2.4.2
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/Gemfile +1 -0
- data/Gemfile.lock +13 -12
- data/lib/log_sanity/formatter.rb +16 -0
- data/lib/log_sanity/log_subscribers/action_dispatch.rb +3 -2
- data/lib/log_sanity/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b9982a5183d65635603c102e0788e83010c3ac1ae86cc13c68fbd5b3d65d659
|
|
4
|
+
data.tar.gz: e974be91e1607e9dbc4f1d73d57af78380b2fb19f3d092a06c197a02e46edc6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53fe271ac8e28f66a7f50f17d40bcfbae6eec70480d8b555b8ca2ea53d36882388b921600f3d06f0295086fcc8bf8a243f46c3704acbf0614dbce8aeb11cbcae
|
|
7
|
+
data.tar.gz: 169c685510819a59b050187cb4848b8e13a58ac4e18b68fc22d355e47357fbd39e57c3f12e33f1bbad37970247d97e9760a10c63118f99574b1440aef7e02875
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
log_sanity (2.4.
|
|
4
|
+
log_sanity (2.4.2)
|
|
5
5
|
rails (>= 7.1.2, < 8.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -82,27 +82,27 @@ GEM
|
|
|
82
82
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
83
83
|
uri (>= 0.13.1)
|
|
84
84
|
base64 (0.3.0)
|
|
85
|
-
bigdecimal (
|
|
85
|
+
bigdecimal (4.0.1)
|
|
86
86
|
builder (3.3.0)
|
|
87
87
|
concurrent-ruby (1.3.6)
|
|
88
88
|
connection_pool (3.0.2)
|
|
89
89
|
crass (1.0.6)
|
|
90
90
|
date (3.5.1)
|
|
91
91
|
drb (2.2.3)
|
|
92
|
-
erb (6.0.
|
|
92
|
+
erb (6.0.1)
|
|
93
93
|
erubi (1.13.1)
|
|
94
94
|
globalid (1.3.0)
|
|
95
95
|
activesupport (>= 6.1)
|
|
96
96
|
i18n (1.14.7)
|
|
97
97
|
concurrent-ruby (~> 1.0)
|
|
98
|
-
io-console (0.8.
|
|
99
|
-
irb (1.
|
|
98
|
+
io-console (0.8.2)
|
|
99
|
+
irb (1.16.0)
|
|
100
100
|
pp (>= 0.6.0)
|
|
101
101
|
rdoc (>= 4.0.0)
|
|
102
102
|
reline (>= 0.4.2)
|
|
103
103
|
json (2.18.0)
|
|
104
104
|
logger (1.7.0)
|
|
105
|
-
loofah (2.
|
|
105
|
+
loofah (2.25.0)
|
|
106
106
|
crass (~> 1.0.2)
|
|
107
107
|
nokogiri (>= 1.12.0)
|
|
108
108
|
mail (2.9.0)
|
|
@@ -114,7 +114,7 @@ GEM
|
|
|
114
114
|
marcel (1.1.0)
|
|
115
115
|
mini_mime (1.1.5)
|
|
116
116
|
minitest (5.27.0)
|
|
117
|
-
net-imap (0.
|
|
117
|
+
net-imap (0.6.2)
|
|
118
118
|
date
|
|
119
119
|
net-protocol
|
|
120
120
|
net-pop (0.1.2)
|
|
@@ -135,7 +135,7 @@ GEM
|
|
|
135
135
|
pp (0.6.3)
|
|
136
136
|
prettyprint
|
|
137
137
|
prettyprint (0.2.0)
|
|
138
|
-
psych (5.3.
|
|
138
|
+
psych (5.3.1)
|
|
139
139
|
date
|
|
140
140
|
stringio
|
|
141
141
|
racc (1.8.1)
|
|
@@ -178,16 +178,16 @@ GEM
|
|
|
178
178
|
tsort (>= 0.2)
|
|
179
179
|
zeitwerk (~> 2.6)
|
|
180
180
|
rake (13.3.1)
|
|
181
|
-
rdoc (
|
|
181
|
+
rdoc (7.0.1)
|
|
182
182
|
erb
|
|
183
183
|
psych (>= 4.0.0)
|
|
184
184
|
tsort
|
|
185
185
|
reline (0.6.3)
|
|
186
186
|
io-console (~> 0.5)
|
|
187
187
|
securerandom (0.4.1)
|
|
188
|
-
stringio (3.
|
|
188
|
+
stringio (3.2.0)
|
|
189
189
|
thor (1.4.0)
|
|
190
|
-
timeout (0.
|
|
190
|
+
timeout (0.6.0)
|
|
191
191
|
tsort (0.2.0)
|
|
192
192
|
tzinfo (2.0.6)
|
|
193
193
|
concurrent-ruby (~> 1.0)
|
|
@@ -197,7 +197,7 @@ GEM
|
|
|
197
197
|
base64
|
|
198
198
|
websocket-extensions (>= 0.1.0)
|
|
199
199
|
websocket-extensions (0.1.5)
|
|
200
|
-
zeitwerk (2.7.
|
|
200
|
+
zeitwerk (2.7.4)
|
|
201
201
|
|
|
202
202
|
PLATFORMS
|
|
203
203
|
aarch64-linux
|
|
@@ -207,6 +207,7 @@ PLATFORMS
|
|
|
207
207
|
|
|
208
208
|
DEPENDENCIES
|
|
209
209
|
log_sanity!
|
|
210
|
+
minitest (~> 5)
|
|
210
211
|
|
|
211
212
|
BUNDLED WITH
|
|
212
213
|
2.6.9
|
data/lib/log_sanity/formatter.rb
CHANGED
|
@@ -28,6 +28,9 @@ module LogSanity
|
|
|
28
28
|
end
|
|
29
29
|
msg['at'] = msg['at'].utc
|
|
30
30
|
"#{msg.to_json}\n"
|
|
31
|
+
rescue JSON::JSONError
|
|
32
|
+
msg = sanitize msg
|
|
33
|
+
"#{msg.to_json}\n"
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
attr_writer :string_formatter
|
|
@@ -37,5 +40,18 @@ module LogSanity
|
|
|
37
40
|
@string_formatter ||= ActiveSupport::Logger::SimpleFormatter.new
|
|
38
41
|
end
|
|
39
42
|
|
|
43
|
+
def sanitize(obj)
|
|
44
|
+
case obj
|
|
45
|
+
when Hash
|
|
46
|
+
obj.transform_keys{|k| sanitize k }.transform_values{|v| sanitize v }
|
|
47
|
+
when Array
|
|
48
|
+
obj.map{|v| sanitize v }
|
|
49
|
+
when String
|
|
50
|
+
obj.dup.force_encoding('utf-8').scrub('.')
|
|
51
|
+
else
|
|
52
|
+
obj
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
40
56
|
end
|
|
41
57
|
end
|
|
@@ -27,8 +27,9 @@ module LogSanity
|
|
|
27
27
|
f2['path'] = request.filtered_env['action_dispatch.original_path']
|
|
28
28
|
f2['path'] ||= request.path
|
|
29
29
|
end
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
unless fields['params']
|
|
31
|
+
fp = request.filtered_parameters rescue {parse_error: "#{$!.class}: #{$!.message.truncate(100)}"}
|
|
32
|
+
f2['params'] = fp if fp.present?
|
|
32
33
|
end
|
|
33
34
|
end
|
|
34
35
|
|
data/lib/log_sanity/version.rb
CHANGED