memolog 0.4.9 → 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: 527f467d6c1d058e7d5f9a25cf3945baf968692fc087d78c0509ae46c74adc49
4
- data.tar.gz: 3f7bf2e8f0617e23c6ceccc20a99a2ad9891395cf88e4db02c782a122dd15df6
3
+ metadata.gz: 396904a701ac8bed9268d19fba38d279e3c20ac3dfbbc434192a3679020bf1dd
4
+ data.tar.gz: 55c3c11a25daef636f51559e3aef40c6c4e01f30ab8f785ba9ae3327acc40978
5
5
  SHA512:
6
- metadata.gz: cdb78ed56cdabc19bd6075a593dd2dc29c222e0d6a7e8c5cdc233cf16996e87782e633a01d08ed540d00fa1ec884b80699c459767c00cddf0c6ee37328177401
7
- data.tar.gz: 1c309ce73a0a5502e3bcf4da561655921814a02f2c13f871f77fd82d88bbaeaa0b4903918b15943984eeec5d10cf485d8b2a7fa3c9bdfaa67867f7e1569df50f
6
+ metadata.gz: d5d74c6c740f9e8e5b0aa424b33e3db92f87bf676b0c56d6b6dfd808adcd235c6a0490c05586561d9cc9d12c80b8ed777a3a1bee3a658ede608d14ea8978cd9d
7
+ data.tar.gz: '0845879632c8e8c4632bce3a78857df8ade5bd57a4db79ac5d73de5d10476fba5710a00177c8c403bd0bd87a473b0959006f5fa6fe95338ec8a1c426690e0b39'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
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
+
1
6
  ## 0.4.9
2
7
  - Ruby 3.2 support
3
8
  - Various gem updates
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- memolog (0.4.9)
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.1)
13
- actionpack (= 7.0.4.1)
14
- activesupport (= 7.0.4.1)
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.1)
18
- actionpack (= 7.0.4.1)
19
- activejob (= 7.0.4.1)
20
- activerecord (= 7.0.4.1)
21
- activestorage (= 7.0.4.1)
22
- activesupport (= 7.0.4.1)
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.1)
28
- actionpack (= 7.0.4.1)
29
- actionview (= 7.0.4.1)
30
- activejob (= 7.0.4.1)
31
- activesupport (= 7.0.4.1)
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.1)
38
- actionview (= 7.0.4.1)
39
- activesupport (= 7.0.4.1)
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.1)
45
- actionpack (= 7.0.4.1)
46
- activerecord (= 7.0.4.1)
47
- activestorage (= 7.0.4.1)
48
- activesupport (= 7.0.4.1)
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.1)
52
- activesupport (= 7.0.4.1)
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.1)
58
- activesupport (= 7.0.4.1)
57
+ activejob (7.0.4.2)
58
+ activesupport (= 7.0.4.2)
59
59
  globalid (>= 0.3.6)
60
- activemodel (7.0.4.1)
61
- activesupport (= 7.0.4.1)
62
- activerecord (7.0.4.1)
63
- activemodel (= 7.0.4.1)
64
- activesupport (= 7.0.4.1)
65
- activestorage (7.0.4.1)
66
- actionpack (= 7.0.4.1)
67
- activejob (= 7.0.4.1)
68
- activerecord (= 7.0.4.1)
69
- activesupport (= 7.0.4.1)
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.1)
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
83
  date (3.3.3)
84
84
  diff-lcs (1.5.0)
85
85
  erubi (1.12.0)
86
- globalid (1.0.1)
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.1)
95
+ mail (2.8.1)
96
96
  mini_mime (>= 0.1.1)
97
97
  net-imap
98
98
  net-pop
@@ -111,14 +111,14 @@ GEM
111
111
  net-smtp (0.3.3)
112
112
  net-protocol
113
113
  nio4r (2.5.8)
114
- nokogiri (1.14.0-arm64-darwin)
114
+ nokogiri (1.14.2-arm64-darwin)
115
115
  racc (~> 1.4)
116
- nokogiri (1.14.0-x86_64-darwin)
116
+ nokogiri (1.14.2-x86_64-darwin)
117
117
  racc (~> 1.4)
118
- nokogiri (1.14.0-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.2.0.0)
121
+ parser (3.2.1.0)
122
122
  ast (~> 2.4.1)
123
123
  pry (0.14.2)
124
124
  coderay (~> 1.1)
@@ -127,43 +127,43 @@ GEM
127
127
  rack (2.2.6.2)
128
128
  rack-test (2.0.2)
129
129
  rack (>= 1.3)
130
- rails (7.0.4.1)
131
- actioncable (= 7.0.4.1)
132
- actionmailbox (= 7.0.4.1)
133
- actionmailer (= 7.0.4.1)
134
- actionpack (= 7.0.4.1)
135
- actiontext (= 7.0.4.1)
136
- actionview (= 7.0.4.1)
137
- activejob (= 7.0.4.1)
138
- activemodel (= 7.0.4.1)
139
- activerecord (= 7.0.4.1)
140
- activestorage (= 7.0.4.1)
141
- activesupport (= 7.0.4.1)
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.1)
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.1)
150
- actionpack (= 7.0.4.1)
151
- activesupport (= 7.0.4.1)
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.12.1)
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
168
  rspec-expectations (3.12.2)
169
169
  diff-lcs (>= 1.2.0, < 2.0)
@@ -182,8 +182,8 @@ GEM
182
182
  rubocop-ast (>= 1.24.1, < 2.0)
183
183
  ruby-progressbar (~> 1.7)
184
184
  unicode-display_width (>= 2.4.0, < 3.0)
185
- rubocop-ast (1.24.1)
186
- parser (>= 3.1.1.0)
185
+ rubocop-ast (1.26.0)
186
+ parser (>= 3.2.1.0)
187
187
  rubocop-config-umbrellio (1.43.0.81)
188
188
  rubocop (~> 1.43.0)
189
189
  rubocop-performance (~> 1.15.0)
@@ -206,20 +206,20 @@ GEM
206
206
  rubocop (~> 1.0)
207
207
  ruby-progressbar (1.11.0)
208
208
  securerandom (0.1.1)
209
- sidekiq (7.0.3)
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
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
data/README.md CHANGED
@@ -28,7 +28,6 @@ Memolog.configure do |config|
28
28
  config.debug = false
29
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
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.9"
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.9
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: 2023-01-19 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.4.1
190
+ rubygems_version: 3.4.6
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: In-memory logger for exceptions.