memolog 0.4.8 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c3118d24e53a96c67912c417327bd3a1eb882ad8bc5bdce1228c8687d480eeb
4
- data.tar.gz: c0f2ab52e467eb5adea1e325acecef0aa0b5ac03e78f96e3800177b1cf28434b
3
+ metadata.gz: 396904a701ac8bed9268d19fba38d279e3c20ac3dfbbc434192a3679020bf1dd
4
+ data.tar.gz: 55c3c11a25daef636f51559e3aef40c6c4e01f30ab8f785ba9ae3327acc40978
5
5
  SHA512:
6
- metadata.gz: f79fbfb5c60f2bafeb16b30c86e3a3a9322052095e84a2daf8ef7873126597713163ae5149830221d9e554da24293b4f03fb751855d1444bcb18cfbefac4861c
7
- data.tar.gz: c06ea9d489d278aaff8e7b170e466fdfcb42be6ccf6b1637f064c48d23fd1a2c4f09a2a19df624888e1ad4cc9cead8091c4d0541eb578317e497807c741da73d
6
+ metadata.gz: d5d74c6c740f9e8e5b0aa424b33e3db92f87bf676b0c56d6b6dfd808adcd235c6a0490c05586561d9cc9d12c80b8ed777a3a1bee3a658ede608d14ea8978cd9d
7
+ data.tar.gz: '0845879632c8e8c4632bce3a78857df8ade5bd57a4db79ac5d73de5d10476fba5710a00177c8c403bd0bd87a473b0959006f5fa6fe95338ec8a1c426690e0b39'
@@ -24,7 +24,7 @@ jobs:
24
24
 
25
25
  strategy:
26
26
  matrix:
27
- ruby: [2.7, 3.0, 3.1]
27
+ ruby: [2.7, 3.0, 3.1, 3.2]
28
28
 
29
29
  steps:
30
30
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.5.0
2
+ - Let user decide when to parse json log or not. Default is false.
3
+ - Sentry data parse json by default.
4
+ - Various gem updates
5
+
6
+ ## 0.4.9
7
+ - Ruby 3.2 support
8
+ - Various gem updates
9
+ - Version bump due to vulnerabilities
10
+
1
11
  ## 0.4.8
2
12
  - Update CHANGELOG
3
13
  - Various gem updates
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- memolog (0.4.8)
4
+ memolog (0.5.0)
5
5
  json (~> 2)
6
6
  logger (~> 1.4.3)
7
7
  securerandom (~> 0.1.0)
@@ -9,67 +9,67 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (7.0.4)
13
- actionpack (= 7.0.4)
14
- activesupport (= 7.0.4)
12
+ actioncable (7.0.4.2)
13
+ actionpack (= 7.0.4.2)
14
+ activesupport (= 7.0.4.2)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
17
- actionmailbox (7.0.4)
18
- actionpack (= 7.0.4)
19
- activejob (= 7.0.4)
20
- activerecord (= 7.0.4)
21
- activestorage (= 7.0.4)
22
- activesupport (= 7.0.4)
17
+ actionmailbox (7.0.4.2)
18
+ actionpack (= 7.0.4.2)
19
+ activejob (= 7.0.4.2)
20
+ activerecord (= 7.0.4.2)
21
+ activestorage (= 7.0.4.2)
22
+ activesupport (= 7.0.4.2)
23
23
  mail (>= 2.7.1)
24
24
  net-imap
25
25
  net-pop
26
26
  net-smtp
27
- actionmailer (7.0.4)
28
- actionpack (= 7.0.4)
29
- actionview (= 7.0.4)
30
- activejob (= 7.0.4)
31
- activesupport (= 7.0.4)
27
+ actionmailer (7.0.4.2)
28
+ actionpack (= 7.0.4.2)
29
+ actionview (= 7.0.4.2)
30
+ activejob (= 7.0.4.2)
31
+ activesupport (= 7.0.4.2)
32
32
  mail (~> 2.5, >= 2.5.4)
33
33
  net-imap
34
34
  net-pop
35
35
  net-smtp
36
36
  rails-dom-testing (~> 2.0)
37
- actionpack (7.0.4)
38
- actionview (= 7.0.4)
39
- activesupport (= 7.0.4)
37
+ actionpack (7.0.4.2)
38
+ actionview (= 7.0.4.2)
39
+ activesupport (= 7.0.4.2)
40
40
  rack (~> 2.0, >= 2.2.0)
41
41
  rack-test (>= 0.6.3)
42
42
  rails-dom-testing (~> 2.0)
43
43
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
44
- actiontext (7.0.4)
45
- actionpack (= 7.0.4)
46
- activerecord (= 7.0.4)
47
- activestorage (= 7.0.4)
48
- activesupport (= 7.0.4)
44
+ actiontext (7.0.4.2)
45
+ actionpack (= 7.0.4.2)
46
+ activerecord (= 7.0.4.2)
47
+ activestorage (= 7.0.4.2)
48
+ activesupport (= 7.0.4.2)
49
49
  globalid (>= 0.6.0)
50
50
  nokogiri (>= 1.8.5)
51
- actionview (7.0.4)
52
- activesupport (= 7.0.4)
51
+ actionview (7.0.4.2)
52
+ activesupport (= 7.0.4.2)
53
53
  builder (~> 3.1)
54
54
  erubi (~> 1.4)
55
55
  rails-dom-testing (~> 2.0)
56
56
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
57
- activejob (7.0.4)
58
- activesupport (= 7.0.4)
57
+ activejob (7.0.4.2)
58
+ activesupport (= 7.0.4.2)
59
59
  globalid (>= 0.3.6)
60
- activemodel (7.0.4)
61
- activesupport (= 7.0.4)
62
- activerecord (7.0.4)
63
- activemodel (= 7.0.4)
64
- activesupport (= 7.0.4)
65
- activestorage (7.0.4)
66
- actionpack (= 7.0.4)
67
- activejob (= 7.0.4)
68
- activerecord (= 7.0.4)
69
- activesupport (= 7.0.4)
60
+ activemodel (7.0.4.2)
61
+ activesupport (= 7.0.4.2)
62
+ activerecord (7.0.4.2)
63
+ activemodel (= 7.0.4.2)
64
+ activesupport (= 7.0.4.2)
65
+ activestorage (7.0.4.2)
66
+ actionpack (= 7.0.4.2)
67
+ activejob (= 7.0.4.2)
68
+ activerecord (= 7.0.4.2)
69
+ activesupport (= 7.0.4.2)
70
70
  marcel (~> 1.0)
71
71
  mini_mime (>= 1.1.0)
72
- activesupport (7.0.4)
72
+ activesupport (7.0.4.2)
73
73
  concurrent-ruby (~> 1.0, >= 1.0.2)
74
74
  i18n (>= 1.6, < 2)
75
75
  minitest (>= 5.1)
@@ -77,13 +77,13 @@ GEM
77
77
  ast (2.4.2)
78
78
  builder (3.2.4)
79
79
  coderay (1.1.3)
80
- concurrent-ruby (1.1.10)
80
+ concurrent-ruby (1.2.0)
81
81
  connection_pool (2.3.0)
82
82
  crass (1.0.6)
83
- date (3.3.1)
83
+ date (3.3.3)
84
84
  diff-lcs (1.5.0)
85
- erubi (1.11.0)
86
- globalid (1.0.0)
85
+ erubi (1.12.0)
86
+ globalid (1.1.0)
87
87
  activesupport (>= 5.0)
88
88
  i18n (1.12.0)
89
89
  concurrent-ruby (~> 1.0)
@@ -92,7 +92,7 @@ GEM
92
92
  loofah (2.19.1)
93
93
  crass (~> 1.0.2)
94
94
  nokogiri (>= 1.5.9)
95
- mail (2.8.0)
95
+ mail (2.8.1)
96
96
  mini_mime (>= 0.1.1)
97
97
  net-imap
98
98
  net-pop
@@ -100,8 +100,8 @@ GEM
100
100
  marcel (1.0.2)
101
101
  method_source (1.0.0)
102
102
  mini_mime (1.1.2)
103
- minitest (5.16.3)
104
- net-imap (0.3.2)
103
+ minitest (5.17.0)
104
+ net-imap (0.3.4)
105
105
  date
106
106
  net-protocol
107
107
  net-pop (0.1.2)
@@ -111,115 +111,115 @@ GEM
111
111
  net-smtp (0.3.3)
112
112
  net-protocol
113
113
  nio4r (2.5.8)
114
- nokogiri (1.13.10-arm64-darwin)
114
+ nokogiri (1.14.2-arm64-darwin)
115
115
  racc (~> 1.4)
116
- nokogiri (1.13.10-x86_64-darwin)
116
+ nokogiri (1.14.2-x86_64-darwin)
117
117
  racc (~> 1.4)
118
- nokogiri (1.13.10-x86_64-linux)
118
+ nokogiri (1.14.2-x86_64-linux)
119
119
  racc (~> 1.4)
120
120
  parallel (1.22.1)
121
- parser (3.1.3.0)
121
+ parser (3.2.1.0)
122
122
  ast (~> 2.4.1)
123
- pry (0.14.1)
123
+ pry (0.14.2)
124
124
  coderay (~> 1.1)
125
125
  method_source (~> 1.0)
126
- racc (1.6.1)
127
- rack (2.2.4)
126
+ racc (1.6.2)
127
+ rack (2.2.6.2)
128
128
  rack-test (2.0.2)
129
129
  rack (>= 1.3)
130
- rails (7.0.4)
131
- actioncable (= 7.0.4)
132
- actionmailbox (= 7.0.4)
133
- actionmailer (= 7.0.4)
134
- actionpack (= 7.0.4)
135
- actiontext (= 7.0.4)
136
- actionview (= 7.0.4)
137
- activejob (= 7.0.4)
138
- activemodel (= 7.0.4)
139
- activerecord (= 7.0.4)
140
- activestorage (= 7.0.4)
141
- activesupport (= 7.0.4)
130
+ rails (7.0.4.2)
131
+ actioncable (= 7.0.4.2)
132
+ actionmailbox (= 7.0.4.2)
133
+ actionmailer (= 7.0.4.2)
134
+ actionpack (= 7.0.4.2)
135
+ actiontext (= 7.0.4.2)
136
+ actionview (= 7.0.4.2)
137
+ activejob (= 7.0.4.2)
138
+ activemodel (= 7.0.4.2)
139
+ activerecord (= 7.0.4.2)
140
+ activestorage (= 7.0.4.2)
141
+ activesupport (= 7.0.4.2)
142
142
  bundler (>= 1.15.0)
143
- railties (= 7.0.4)
143
+ railties (= 7.0.4.2)
144
144
  rails-dom-testing (2.0.3)
145
145
  activesupport (>= 4.2.0)
146
146
  nokogiri (>= 1.6)
147
- rails-html-sanitizer (1.4.4)
147
+ rails-html-sanitizer (1.5.0)
148
148
  loofah (~> 2.19, >= 2.19.1)
149
- railties (7.0.4)
150
- actionpack (= 7.0.4)
151
- activesupport (= 7.0.4)
149
+ railties (7.0.4.2)
150
+ actionpack (= 7.0.4.2)
151
+ activesupport (= 7.0.4.2)
152
152
  method_source
153
153
  rake (>= 12.2)
154
154
  thor (~> 1.0)
155
155
  zeitwerk (~> 2.5)
156
156
  rainbow (3.1.1)
157
157
  rake (13.0.6)
158
- redis-client (0.11.2)
158
+ redis-client (0.12.2)
159
159
  connection_pool
160
- regexp_parser (2.6.1)
160
+ regexp_parser (2.7.0)
161
161
  rexml (3.2.5)
162
162
  rspec (3.12.0)
163
163
  rspec-core (~> 3.12.0)
164
164
  rspec-expectations (~> 3.12.0)
165
165
  rspec-mocks (~> 3.12.0)
166
- rspec-core (3.12.0)
166
+ rspec-core (3.12.1)
167
167
  rspec-support (~> 3.12.0)
168
- rspec-expectations (3.12.0)
168
+ rspec-expectations (3.12.2)
169
169
  diff-lcs (>= 1.2.0, < 2.0)
170
170
  rspec-support (~> 3.12.0)
171
- rspec-mocks (3.12.1)
171
+ rspec-mocks (3.12.3)
172
172
  diff-lcs (>= 1.2.0, < 2.0)
173
173
  rspec-support (~> 3.12.0)
174
174
  rspec-support (3.12.0)
175
- rubocop (1.35.1)
175
+ rubocop (1.43.0)
176
176
  json (~> 2.3)
177
177
  parallel (~> 1.10)
178
- parser (>= 3.1.2.1)
178
+ parser (>= 3.2.0.0)
179
179
  rainbow (>= 2.2.2, < 4.0)
180
180
  regexp_parser (>= 1.8, < 3.0)
181
181
  rexml (>= 3.2.5, < 4.0)
182
- rubocop-ast (>= 1.20.1, < 2.0)
182
+ rubocop-ast (>= 1.24.1, < 2.0)
183
183
  ruby-progressbar (~> 1.7)
184
- unicode-display_width (>= 1.4.0, < 3.0)
185
- rubocop-ast (1.24.0)
186
- parser (>= 3.1.1.0)
187
- rubocop-config-umbrellio (1.35.0.69)
188
- rubocop (~> 1.35.0)
189
- rubocop-performance (~> 1.14.0)
190
- rubocop-rails (~> 2.15.0)
184
+ unicode-display_width (>= 2.4.0, < 3.0)
185
+ rubocop-ast (1.26.0)
186
+ parser (>= 3.2.1.0)
187
+ rubocop-config-umbrellio (1.43.0.81)
188
+ rubocop (~> 1.43.0)
189
+ rubocop-performance (~> 1.15.0)
190
+ rubocop-rails (~> 2.17.0)
191
191
  rubocop-rake (~> 0.6.0)
192
- rubocop-rspec (~> 2.12.0)
192
+ rubocop-rspec (~> 2.16.0)
193
193
  rubocop-sequel (~> 0.3.3)
194
- rubocop-performance (1.14.3)
194
+ rubocop-performance (1.15.2)
195
195
  rubocop (>= 1.7.0, < 2.0)
196
196
  rubocop-ast (>= 0.4.0)
197
- rubocop-rails (2.15.2)
197
+ rubocop-rails (2.17.4)
198
198
  activesupport (>= 4.2.0)
199
199
  rack (>= 1.1)
200
- rubocop (>= 1.7.0, < 2.0)
200
+ rubocop (>= 1.33.0, < 2.0)
201
201
  rubocop-rake (0.6.0)
202
202
  rubocop (~> 1.0)
203
- rubocop-rspec (2.12.1)
204
- rubocop (~> 1.31)
203
+ rubocop-rspec (2.16.0)
204
+ rubocop (~> 1.33)
205
205
  rubocop-sequel (0.3.4)
206
206
  rubocop (~> 1.0)
207
207
  ruby-progressbar (1.11.0)
208
208
  securerandom (0.1.1)
209
- sidekiq (7.0.2)
209
+ sidekiq (7.0.6)
210
210
  concurrent-ruby (< 2)
211
211
  connection_pool (>= 2.3.0)
212
212
  rack (>= 2.2.4)
213
213
  redis-client (>= 0.11.0)
214
214
  thor (1.2.1)
215
- timeout (0.3.1)
216
- tzinfo (2.0.5)
215
+ timeout (0.3.2)
216
+ tzinfo (2.0.6)
217
217
  concurrent-ruby (~> 1.0)
218
- unicode-display_width (2.3.0)
218
+ unicode-display_width (2.4.2)
219
219
  websocket-driver (0.7.5)
220
220
  websocket-extensions (>= 0.1.0)
221
221
  websocket-extensions (0.1.5)
222
- zeitwerk (2.6.6)
222
+ zeitwerk (2.6.7)
223
223
 
224
224
  PLATFORMS
225
225
  arm64-darwin-22
@@ -237,4 +237,4 @@ DEPENDENCIES
237
237
  sidekiq
238
238
 
239
239
  BUNDLED WITH
240
- 2.3.7
240
+ 2.4.3
data/README.md CHANGED
@@ -26,9 +26,8 @@ Use this example during application initialization process (this example impleme
26
26
  ```ruby
27
27
  Memolog.configure do |config|
28
28
  config.debug = false
29
- config.formatter = ::Logger::Formatter.new
29
+ config.formatter = Logger::Formatter.new
30
30
  config.middlewares = %i[rails sidekiq]
31
- config.log_json = false
32
31
  config.log_size_limit = 50_000
33
32
  end
34
33
 
@@ -39,7 +38,6 @@ Available options are:
39
38
  - `debug` - set it to true if you need to leave Memolog.dump result outside `Memolog.run {}` block.
40
39
  - `formatter` - setup your own formatter.
41
40
  - `middlewares` - define here what you want to initialize in `#init_middlewares!` call.
42
- - `log_json` - `#dump` will try to parse dump with `JSON.parse()`. Default is `false`
43
41
  - `log_size_limit` - max log length in `#dump`.
44
42
 
45
43
  ## Usage
@@ -4,14 +4,12 @@ Memolog::Config = Struct.new(
4
4
  :debug,
5
5
  :formatter,
6
6
  :middlewares,
7
- :parse_json,
8
7
  :log_size_limit,
9
8
  ) do
10
9
  def initialize
11
10
  self.debug = false
12
- self.formatter = ::Logger::Formatter.new
11
+ self.formatter = Logger::Formatter.new
13
12
  self.middlewares = %i[rails sidekiq]
14
- self.parse_json = false
15
13
  self.log_size_limit = 50_000
16
14
  end
17
15
  end
@@ -18,7 +18,7 @@ module Memolog::SentryExtension
18
18
 
19
19
  def set_extras_memolog!
20
20
  return unless get_current_scope
21
- set_extras(memolog: Memolog.dump)
21
+ set_extras(memolog: Memolog.dump(parse_json: true))
22
22
  end
23
23
  end
24
24
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Memolog
4
- VERSION = "0.4.8"
4
+ VERSION = "0.5.0"
5
5
  end
data/lib/memolog.rb CHANGED
@@ -48,7 +48,7 @@ module Memolog
48
48
  logdevs.pop unless config.debug
49
49
  end
50
50
 
51
- def dump
51
+ def dump(parse_json: false)
52
52
  return if logdevs.empty?
53
53
 
54
54
  beginning = logdevs.last.string.length - config.log_size_limit
@@ -56,7 +56,7 @@ module Memolog
56
56
 
57
57
  dump = logdevs.last.string.slice(beginning, config.log_size_limit).presence
58
58
 
59
- dump && config.parse_json ? JSON.parse(dump) : dump
59
+ dump && parse_json ? JSON.parse(dump) : dump
60
60
  rescue JSON::ParserError
61
61
  dump
62
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memolog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stepan Kirushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-15 00:00:00.000000000 Z
11
+ date: 2023-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.3.7
190
+ rubygems_version: 3.4.6
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: In-memory logger for exceptions.