lamian 1.8.0 → 1.9.0

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: 3b57232a152bc551ab708c63da1fc32bd77c38ba58b58ced8f9ea4cfa1f79f17
4
- data.tar.gz: 861029591ca765ab01f01243ea31f86af612dc8837c93e66c5c05e18730586fb
3
+ metadata.gz: 881a6090b7433a7073865fad6fbf0717e1d756f654d0be3d41d4c239d396cd81
4
+ data.tar.gz: 262e942fb2c73fbb80d42882d0fa9d8502df4067613ba5530f998659efe687b1
5
5
  SHA512:
6
- metadata.gz: 4a886b93c920d46c84a6be2ef880b2abf3fd33e6971e81c1564d51c47530d38e6e9ddc91fe21704f46dc238776b775bf9001174f043e485095eb3e471d25b1e4
7
- data.tar.gz: 71bc11a5b32cdcd1fc69b1a4994073043c9bedd498d5db063806cb1fb70dc978b414a4583dea0517967fec1a1fec97ecc81a8dd3aafcd0ca68db2ba4f0a73114
6
+ metadata.gz: '040108c81012fb27273d2a185b7cc7c2ed4563d4881908c4c50a8c54ce160f04c97a00043a9f2f3b96c0bcf63105d7a88c3bef6b94caa2970557b1e3a0f9cf51'
7
+ data.tar.gz: 6cecfa1411d0891061161577d8f60dd8052a8a6e25224c0b50f8202ba2635c6cf88aae437b4718653a257c58e9441f162c90a470c55df6f1ca8adb657467e404
data/Changelog.md CHANGED
@@ -1,19 +1,21 @@
1
- # Lamian version changes (since 0.1.0)
1
+ ## 1.9.0
2
2
 
3
- Update this on a pull request, under `Lamian::VERSION`
4
- (also known as next version). If this constant would be changed without release,
5
- I'll update it here too
3
+ * Add `max_log_lines` config option to limit number of most recent log lines stored in the log device
6
4
 
7
5
  ## 1.8.0
6
+
8
7
  * Minor dependency updates;
9
8
 
10
9
  ## 1.3.0
10
+
11
11
  * Add support for the (new sentry gem)[https://github.com/getsentry/sentry-ruby].
12
12
 
13
13
  ## 1.2.0
14
+
14
15
  * Add `raven_log_size_limit` config option for limiting amount of data sent to sentry (defaults to `500_000`)
15
16
 
16
17
  ## 1.1.0
18
+
17
19
  * Add support for sentry and sidekiq
18
20
 
19
21
  ## 1.0.0
@@ -30,7 +32,6 @@ which ruins concept of single entry point :(. Also tied it to lamian instance
30
32
 
31
33
  * `e57e6cec` Changed rails dependency from `~> 4.2` to `>= 4.2`
32
34
 
33
-
34
35
  ## 0.3.1
35
36
 
36
37
  * 34ca83b5 Fixed formatting
@@ -38,7 +39,6 @@ which ruins concept of single entry point :(. Also tied it to lamian instance
38
39
  Stabilized formatting api, which removes control sequences from loggers data.
39
40
  E.g. `"[23mNice, lol[0m\n"` becomes `"Nice, lol\n"`
40
41
 
41
-
42
42
  ## 0.3.0
43
43
 
44
44
  * `d24f895b` API update
@@ -46,13 +46,13 @@ E.g. `"[23mNice, lol[0m\n"` becomes `"Nice, lol\n"`
46
46
  Updated API, so lamian is now forced to be used with block.
47
47
  It also simplified usage outside a middleware
48
48
 
49
-
50
49
  ## 0.2.0
50
+
51
51
  * `3166517e` Added integrtation with rails
52
52
 
53
53
  Injected middleware before `ExceptionNotification`, so `ExceptionNotification`
54
54
  can use current log without any configuration. Also added some views
55
55
 
56
-
57
56
  ## 0.1.0
57
+
58
58
  * `62eb8685` Made test version to check it's integration with rails application
data/Gemfile CHANGED
@@ -4,3 +4,17 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in lamian.gemspec
6
6
  gemspec
7
+
8
+ gem "bundler-audit"
9
+ gem "ci-helper"
10
+ gem "launchy"
11
+ gem "pry"
12
+ gem "rake"
13
+ gem "rspec"
14
+ gem "rubocop-config-umbrellio"
15
+ gem "semantic_logger"
16
+ gem "sentry-raven"
17
+ gem "sentry-ruby"
18
+ gem "simplecov"
19
+ gem "simplecov-lcov"
20
+ gem "yard"
data/Gemfile.lock CHANGED
@@ -1,41 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamian (1.8.0)
4
+ lamian (1.9.0)
5
5
  rails (>= 4.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.1.3)
11
- actionpack (= 7.1.3)
12
- activesupport (= 7.1.3)
10
+ actioncable (7.1.3.4)
11
+ actionpack (= 7.1.3.4)
12
+ activesupport (= 7.1.3.4)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
15
  zeitwerk (~> 2.6)
16
- actionmailbox (7.1.3)
17
- actionpack (= 7.1.3)
18
- activejob (= 7.1.3)
19
- activerecord (= 7.1.3)
20
- activestorage (= 7.1.3)
21
- activesupport (= 7.1.3)
16
+ actionmailbox (7.1.3.4)
17
+ actionpack (= 7.1.3.4)
18
+ activejob (= 7.1.3.4)
19
+ activerecord (= 7.1.3.4)
20
+ activestorage (= 7.1.3.4)
21
+ activesupport (= 7.1.3.4)
22
22
  mail (>= 2.7.1)
23
23
  net-imap
24
24
  net-pop
25
25
  net-smtp
26
- actionmailer (7.1.3)
27
- actionpack (= 7.1.3)
28
- actionview (= 7.1.3)
29
- activejob (= 7.1.3)
30
- activesupport (= 7.1.3)
26
+ actionmailer (7.1.3.4)
27
+ actionpack (= 7.1.3.4)
28
+ actionview (= 7.1.3.4)
29
+ activejob (= 7.1.3.4)
30
+ activesupport (= 7.1.3.4)
31
31
  mail (~> 2.5, >= 2.5.4)
32
32
  net-imap
33
33
  net-pop
34
34
  net-smtp
35
35
  rails-dom-testing (~> 2.2)
36
- actionpack (7.1.3)
37
- actionview (= 7.1.3)
38
- activesupport (= 7.1.3)
36
+ actionpack (7.1.3.4)
37
+ actionview (= 7.1.3.4)
38
+ activesupport (= 7.1.3.4)
39
39
  nokogiri (>= 1.8.5)
40
40
  racc
41
41
  rack (>= 2.2.4)
@@ -43,35 +43,35 @@ GEM
43
43
  rack-test (>= 0.6.3)
44
44
  rails-dom-testing (~> 2.2)
45
45
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.3)
47
- actionpack (= 7.1.3)
48
- activerecord (= 7.1.3)
49
- activestorage (= 7.1.3)
50
- activesupport (= 7.1.3)
46
+ actiontext (7.1.3.4)
47
+ actionpack (= 7.1.3.4)
48
+ activerecord (= 7.1.3.4)
49
+ activestorage (= 7.1.3.4)
50
+ activesupport (= 7.1.3.4)
51
51
  globalid (>= 0.6.0)
52
52
  nokogiri (>= 1.8.5)
53
- actionview (7.1.3)
54
- activesupport (= 7.1.3)
53
+ actionview (7.1.3.4)
54
+ activesupport (= 7.1.3.4)
55
55
  builder (~> 3.1)
56
56
  erubi (~> 1.11)
57
57
  rails-dom-testing (~> 2.2)
58
58
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.3)
60
- activesupport (= 7.1.3)
59
+ activejob (7.1.3.4)
60
+ activesupport (= 7.1.3.4)
61
61
  globalid (>= 0.3.6)
62
- activemodel (7.1.3)
63
- activesupport (= 7.1.3)
64
- activerecord (7.1.3)
65
- activemodel (= 7.1.3)
66
- activesupport (= 7.1.3)
62
+ activemodel (7.1.3.4)
63
+ activesupport (= 7.1.3.4)
64
+ activerecord (7.1.3.4)
65
+ activemodel (= 7.1.3.4)
66
+ activesupport (= 7.1.3.4)
67
67
  timeout (>= 0.4.0)
68
- activestorage (7.1.3)
69
- actionpack (= 7.1.3)
70
- activejob (= 7.1.3)
71
- activerecord (= 7.1.3)
72
- activesupport (= 7.1.3)
68
+ activestorage (7.1.3.4)
69
+ actionpack (= 7.1.3.4)
70
+ activejob (= 7.1.3.4)
71
+ activerecord (= 7.1.3.4)
72
+ activesupport (= 7.1.3.4)
73
73
  marcel (~> 1.0)
74
- activesupport (7.1.3)
74
+ activesupport (7.1.3.4)
75
75
  base64
76
76
  bigdecimal
77
77
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -81,46 +81,48 @@ GEM
81
81
  minitest (>= 5.1)
82
82
  mutex_m
83
83
  tzinfo (~> 2.0)
84
- addressable (2.8.1)
85
- public_suffix (>= 2.0.2, < 6.0)
84
+ addressable (2.8.7)
85
+ public_suffix (>= 2.0.2, < 7.0)
86
86
  ast (2.4.2)
87
87
  base64 (0.2.0)
88
- bigdecimal (3.1.6)
89
- builder (3.2.4)
88
+ bigdecimal (3.1.8)
89
+ builder (3.3.0)
90
90
  bundler-audit (0.9.1)
91
91
  bundler (>= 1.2.0, < 3)
92
92
  thor (~> 1.0)
93
- ci-helper (0.5.0)
94
- colorize (~> 0.8)
95
- dry-inflector (~> 0.2)
96
- umbrellio-sequel-plugins (~> 0.4)
93
+ childprocess (5.0.0)
94
+ ci-helper (0.6.0)
95
+ colorize (~> 1.1)
96
+ dry-inflector (~> 1.0)
97
+ umbrellio-sequel-plugins (~> 0.14)
97
98
  coderay (1.1.3)
98
- colorize (0.8.1)
99
- concurrent-ruby (1.2.3)
99
+ colorize (1.1.0)
100
+ concurrent-ruby (1.3.3)
100
101
  connection_pool (2.4.1)
101
102
  crass (1.0.6)
102
103
  date (3.3.4)
103
- diff-lcs (1.5.0)
104
+ diff-lcs (1.5.1)
104
105
  docile (1.4.0)
105
- drb (2.2.0)
106
- ruby2_keywords
107
- dry-inflector (0.3.0)
108
- erubi (1.12.0)
109
- faraday (2.6.0)
110
- faraday-net_http (>= 2.0, < 3.1)
111
- ruby2_keywords (>= 0.0.4)
112
- faraday-net_http (3.0.1)
106
+ drb (2.2.1)
107
+ dry-inflector (1.0.0)
108
+ erubi (1.13.0)
109
+ faraday (2.9.2)
110
+ faraday-net_http (>= 2.0, < 3.2)
111
+ faraday-net_http (3.1.0)
112
+ net-http
113
113
  globalid (1.2.1)
114
114
  activesupport (>= 6.1)
115
- i18n (1.14.1)
115
+ i18n (1.14.5)
116
116
  concurrent-ruby (~> 1.0)
117
117
  io-console (0.7.2)
118
- irb (1.11.1)
119
- rdoc
118
+ irb (1.13.2)
119
+ rdoc (>= 4.0.0)
120
120
  reline (>= 0.4.2)
121
- json (2.6.2)
122
- launchy (2.5.0)
123
- addressable (~> 2.7)
121
+ json (2.7.2)
122
+ language_server-protocol (3.17.0.3)
123
+ launchy (3.0.1)
124
+ addressable (~> 2.8)
125
+ childprocess (~> 5.0)
124
126
  loofah (2.22.0)
125
127
  crass (~> 1.0.2)
126
128
  nokogiri (>= 1.12.0)
@@ -129,61 +131,64 @@ GEM
129
131
  net-imap
130
132
  net-pop
131
133
  net-smtp
132
- marcel (1.0.2)
133
- method_source (1.0.0)
134
+ marcel (1.0.4)
135
+ method_source (1.1.0)
134
136
  mini_mime (1.1.5)
135
- mini_portile2 (2.8.5)
136
- minitest (5.21.2)
137
+ mini_portile2 (2.8.7)
138
+ minitest (5.24.0)
137
139
  mutex_m (0.2.0)
138
- net-imap (0.4.9.1)
140
+ net-http (0.4.1)
141
+ uri
142
+ net-imap (0.4.14)
139
143
  date
140
144
  net-protocol
141
145
  net-pop (0.1.2)
142
146
  net-protocol
143
147
  net-protocol (0.2.2)
144
148
  timeout
145
- net-smtp (0.4.0.1)
149
+ net-smtp (0.5.0)
146
150
  net-protocol
147
- nio4r (2.7.0)
148
- nokogiri (1.16.0)
151
+ nio4r (2.7.3)
152
+ nokogiri (1.16.6)
149
153
  mini_portile2 (~> 2.8.2)
150
154
  racc (~> 1.4)
151
- nokogiri (1.16.0-x86_64-darwin)
155
+ nokogiri (1.16.6-x86_64-darwin)
152
156
  racc (~> 1.4)
153
- nokogiri (1.16.0-x86_64-linux)
157
+ nokogiri (1.16.6-x86_64-linux)
154
158
  racc (~> 1.4)
155
- parallel (1.22.1)
156
- parser (3.1.2.1)
159
+ parallel (1.25.1)
160
+ parser (3.3.3.0)
157
161
  ast (~> 2.4.1)
158
- pry (0.14.1)
162
+ racc
163
+ pry (0.14.2)
159
164
  coderay (~> 1.1)
160
165
  method_source (~> 1.0)
161
166
  psych (5.1.2)
162
167
  stringio
163
- public_suffix (5.0.0)
164
- racc (1.7.3)
165
- rack (3.0.8)
168
+ public_suffix (6.0.0)
169
+ racc (1.8.0)
170
+ rack (3.1.4)
166
171
  rack-session (2.0.0)
167
172
  rack (>= 3.0.0)
168
173
  rack-test (2.1.0)
169
174
  rack (>= 1.3)
170
- rackup (2.0.0)
175
+ rackup (2.1.0)
171
176
  rack (>= 3)
172
- webrick
173
- rails (7.1.3)
174
- actioncable (= 7.1.3)
175
- actionmailbox (= 7.1.3)
176
- actionmailer (= 7.1.3)
177
- actionpack (= 7.1.3)
178
- actiontext (= 7.1.3)
179
- actionview (= 7.1.3)
180
- activejob (= 7.1.3)
181
- activemodel (= 7.1.3)
182
- activerecord (= 7.1.3)
183
- activestorage (= 7.1.3)
184
- activesupport (= 7.1.3)
177
+ webrick (~> 1.8)
178
+ rails (7.1.3.4)
179
+ actioncable (= 7.1.3.4)
180
+ actionmailbox (= 7.1.3.4)
181
+ actionmailer (= 7.1.3.4)
182
+ actionpack (= 7.1.3.4)
183
+ actiontext (= 7.1.3.4)
184
+ actionview (= 7.1.3.4)
185
+ activejob (= 7.1.3.4)
186
+ activemodel (= 7.1.3.4)
187
+ activerecord (= 7.1.3.4)
188
+ activestorage (= 7.1.3.4)
189
+ activesupport (= 7.1.3.4)
185
190
  bundler (>= 1.15.0)
186
- railties (= 7.1.3)
191
+ railties (= 7.1.3.4)
187
192
  rails-dom-testing (2.2.0)
188
193
  activesupport (>= 5.0.0)
189
194
  minitest
@@ -191,100 +196,114 @@ GEM
191
196
  rails-html-sanitizer (1.6.0)
192
197
  loofah (~> 2.21)
193
198
  nokogiri (~> 1.14)
194
- railties (7.1.3)
195
- actionpack (= 7.1.3)
196
- activesupport (= 7.1.3)
199
+ railties (7.1.3.4)
200
+ actionpack (= 7.1.3.4)
201
+ activesupport (= 7.1.3.4)
197
202
  irb
198
203
  rackup (>= 1.0.0)
199
204
  rake (>= 12.2)
200
205
  thor (~> 1.0, >= 1.2.2)
201
206
  zeitwerk (~> 2.6)
202
207
  rainbow (3.1.1)
203
- rake (13.1.0)
204
- rdoc (6.6.2)
208
+ rake (13.2.1)
209
+ rdoc (6.7.0)
205
210
  psych (>= 4.0.0)
206
- regexp_parser (2.6.0)
207
- reline (0.4.2)
211
+ regexp_parser (2.9.2)
212
+ reline (0.5.9)
208
213
  io-console (~> 0.5)
209
- rexml (3.2.5)
210
- rspec (3.12.0)
211
- rspec-core (~> 3.12.0)
212
- rspec-expectations (~> 3.12.0)
213
- rspec-mocks (~> 3.12.0)
214
- rspec-core (3.12.2)
215
- rspec-support (~> 3.12.0)
216
- rspec-expectations (3.12.3)
214
+ rexml (3.3.1)
215
+ strscan
216
+ rspec (3.13.0)
217
+ rspec-core (~> 3.13.0)
218
+ rspec-expectations (~> 3.13.0)
219
+ rspec-mocks (~> 3.13.0)
220
+ rspec-core (3.13.0)
221
+ rspec-support (~> 3.13.0)
222
+ rspec-expectations (3.13.1)
217
223
  diff-lcs (>= 1.2.0, < 2.0)
218
- rspec-support (~> 3.12.0)
219
- rspec-mocks (3.12.6)
224
+ rspec-support (~> 3.13.0)
225
+ rspec-mocks (3.13.1)
220
226
  diff-lcs (>= 1.2.0, < 2.0)
221
- rspec-support (~> 3.12.0)
222
- rspec-support (3.12.1)
223
- rubocop (1.35.1)
227
+ rspec-support (~> 3.13.0)
228
+ rspec-support (3.13.1)
229
+ rubocop (1.63.5)
224
230
  json (~> 2.3)
231
+ language_server-protocol (>= 3.17.0)
225
232
  parallel (~> 1.10)
226
- parser (>= 3.1.2.1)
233
+ parser (>= 3.3.0.2)
227
234
  rainbow (>= 2.2.2, < 4.0)
228
235
  regexp_parser (>= 1.8, < 3.0)
229
236
  rexml (>= 3.2.5, < 4.0)
230
- rubocop-ast (>= 1.20.1, < 2.0)
237
+ rubocop-ast (>= 1.31.1, < 2.0)
231
238
  ruby-progressbar (~> 1.7)
232
- unicode-display_width (>= 1.4.0, < 3.0)
233
- rubocop-ast (1.23.0)
234
- parser (>= 3.1.1.0)
235
- rubocop-config-umbrellio (1.35.0.69)
236
- rubocop (~> 1.35.0)
237
- rubocop-performance (~> 1.14.0)
238
- rubocop-rails (~> 2.15.0)
239
+ unicode-display_width (>= 2.4.0, < 3.0)
240
+ rubocop-ast (1.31.3)
241
+ parser (>= 3.3.1.0)
242
+ rubocop-capybara (2.21.0)
243
+ rubocop (~> 1.41)
244
+ rubocop-config-umbrellio (1.63.0.93)
245
+ rubocop (~> 1.63.0)
246
+ rubocop-performance (~> 1.21.0)
247
+ rubocop-rails (~> 2.24.0)
239
248
  rubocop-rake (~> 0.6.0)
240
- rubocop-rspec (~> 2.12.0)
249
+ rubocop-rspec (~> 2.29.0)
241
250
  rubocop-sequel (~> 0.3.3)
242
- rubocop-performance (1.14.3)
243
- rubocop (>= 1.7.0, < 2.0)
244
- rubocop-ast (>= 0.4.0)
245
- rubocop-rails (2.15.2)
251
+ rubocop-factory_bot (2.26.1)
252
+ rubocop (~> 1.61)
253
+ rubocop-performance (1.21.1)
254
+ rubocop (>= 1.48.1, < 2.0)
255
+ rubocop-ast (>= 1.31.1, < 2.0)
256
+ rubocop-rails (2.24.1)
246
257
  activesupport (>= 4.2.0)
247
258
  rack (>= 1.1)
248
- rubocop (>= 1.7.0, < 2.0)
259
+ rubocop (>= 1.33.0, < 2.0)
260
+ rubocop-ast (>= 1.31.1, < 2.0)
249
261
  rubocop-rake (0.6.0)
250
262
  rubocop (~> 1.0)
251
- rubocop-rspec (2.12.1)
252
- rubocop (~> 1.31)
263
+ rubocop-rspec (2.29.2)
264
+ rubocop (~> 1.40)
265
+ rubocop-capybara (~> 2.17)
266
+ rubocop-factory_bot (~> 2.22)
267
+ rubocop-rspec_rails (~> 2.28)
268
+ rubocop-rspec_rails (2.29.1)
269
+ rubocop (~> 1.61)
253
270
  rubocop-sequel (0.3.4)
254
271
  rubocop (~> 1.0)
255
- ruby-progressbar (1.11.0)
256
- ruby2_keywords (0.0.5)
257
- semantic_logger (4.11.0)
272
+ ruby-progressbar (1.13.0)
273
+ semantic_logger (4.15.0)
258
274
  concurrent-ruby (~> 1.0)
259
275
  sentry-raven (3.1.2)
260
276
  faraday (>= 1.0)
261
- sentry-ruby (5.5.0)
277
+ sentry-ruby (5.18.0)
278
+ bigdecimal
262
279
  concurrent-ruby (~> 1.0, >= 1.0.2)
263
- sequel (5.61.0)
264
- simplecov (0.21.2)
280
+ sequel (5.81.0)
281
+ bigdecimal
282
+ simplecov (0.22.0)
265
283
  docile (~> 1.1)
266
284
  simplecov-html (~> 0.11)
267
285
  simplecov_json_formatter (~> 0.1)
268
286
  simplecov-html (0.12.3)
269
287
  simplecov-lcov (0.8.0)
270
288
  simplecov_json_formatter (0.1.4)
271
- stringio (3.1.0)
289
+ stringio (3.1.1)
290
+ strscan (3.1.0)
272
291
  symbiont-ruby (0.7.0)
273
- thor (1.3.0)
292
+ thor (1.3.1)
274
293
  timeout (0.4.1)
275
294
  tzinfo (2.0.6)
276
295
  concurrent-ruby (~> 1.0)
277
- umbrellio-sequel-plugins (0.10.0.86)
296
+ umbrellio-sequel-plugins (0.15.0.198)
278
297
  sequel
279
298
  symbiont-ruby
280
- unicode-display_width (2.3.0)
281
- webrick (1.7.0)
299
+ unicode-display_width (2.5.0)
300
+ uri (0.13.0)
301
+ webrick (1.8.1)
282
302
  websocket-driver (0.7.6)
283
303
  websocket-extensions (>= 0.1.0)
284
304
  websocket-extensions (0.1.5)
285
- yard (0.9.28)
286
- webrick (~> 1.7.0)
287
- zeitwerk (2.6.12)
305
+ yard (0.9.36)
306
+ zeitwerk (2.6.16)
288
307
 
289
308
  PLATFORMS
290
309
  ruby
@@ -309,4 +328,4 @@ DEPENDENCIES
309
328
  yard
310
329
 
311
330
  BUNDLED WITH
312
- 2.3.24
331
+ 2.5.9
data/lib/lamian/config.rb CHANGED
@@ -1,16 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "logger"
4
-
5
3
  module Lamian
6
4
  # General lamian configuration class
7
5
  # @attr formatter [Logger::Foramtter]
8
6
  # formatter to use in lamian, global
7
+ # @attr max_log_lines [Integer]
8
+ # max number of most recent log lines to store, defaults to 5000
9
9
  # @attr raven_log_size_limit [Integer]
10
10
  # size limit when sending lamian log to sentry, defaults to +500_000+
11
- Config = Struct.new(:formatter, :raven_log_size_limit) do
11
+ Config = Struct.new(:formatter, :max_log_lines, :raven_log_size_limit) do
12
12
  def initialize
13
13
  self.formatter = ::Logger::Formatter.new
14
+ self.max_log_lines = 5000
14
15
  self.raven_log_size_limit = 500_000
15
16
  end
16
17
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lamian
4
+ class LogDevice # :nodoc:
5
+ def initialize(size = Lamian.config.max_log_lines)
6
+ self.size = size
7
+ self.lines = []
8
+ end
9
+
10
+ def write(string) # :nodoc:
11
+ lines << string
12
+ lines.shift if lines.size > size
13
+ true
14
+ end
15
+
16
+ def string # :nodoc:
17
+ lines.join
18
+ end
19
+
20
+ private
21
+
22
+ attr_accessor :size, :lines
23
+ end
24
+ end
data/lib/lamian/logger.rb CHANGED
@@ -23,8 +23,7 @@ module Lamian
23
23
  # @see Lamian.run
24
24
  # Collects logs sent inside block
25
25
  def run
26
- logdevs.push(StringIO.new)
27
-
26
+ logdevs.push(Lamian::LogDevice.new)
28
27
  yield
29
28
  ensure
30
29
  logdevs.pop
@@ -13,5 +13,5 @@ module Lamian
13
13
  # According to this, it is enough to specify '~> a.b'
14
14
  # if private API was not used and to specify '~> a.b.c' if it was
15
15
 
16
- VERSION = "1.8.0"
16
+ VERSION = "1.9.0"
17
17
  end
data/lib/lamian.rb CHANGED
@@ -9,6 +9,7 @@ module Lamian
9
9
  autoload :Config, "lamian/config"
10
10
  autoload :Logger, "lamian/logger"
11
11
  autoload :LoggerExtension, "lamian/logger_extension"
12
+ autoload :LogDevice, "lamian/log_device"
12
13
  autoload :Middleware, "lamian/middleware"
13
14
  autoload :RavenContextExtension, "lamian/raven_context_extension"
14
15
  autoload :SidekiqRavenMiddleware, "lamian/sidekiq_raven_middleware"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lamian
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JelF
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-31 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,188 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler-audit
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: ci-helper
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: launchy
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-config-umbrellio
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: semantic_logger
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: sentry-raven
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: sentry-ruby
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: simplecov
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: simplecov-lcov
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: yard
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
27
  description: Add logs to your error messages, using exception_notifier or smth like
210
28
  it
211
29
  email:
@@ -230,6 +48,7 @@ files:
230
48
  - lib/lamian.rb
231
49
  - lib/lamian/config.rb
232
50
  - lib/lamian/engine.rb
51
+ - lib/lamian/log_device.rb
233
52
  - lib/lamian/logger.rb
234
53
  - lib/lamian/logger_extension.rb
235
54
  - lib/lamian/middleware.rb
@@ -260,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
79
  - !ruby/object:Gem::Version
261
80
  version: '0'
262
81
  requirements: []
263
- rubygems_version: 3.5.3
82
+ rubygems_version: 3.5.11
264
83
  signing_key:
265
84
  specification_version: 4
266
85
  summary: Add logs to your error messages