memolog 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/Gemfile.lock +125 -106
- data/README.md +13 -6
- data/lib/memolog/config.rb +5 -5
- data/lib/memolog/init.rb +9 -9
- data/lib/memolog/{extension.rb → logger_extension.rb} +1 -1
- data/lib/memolog/sentry_extension.rb +1 -1
- data/lib/memolog/version.rb +1 -1
- data/lib/memolog.rb +10 -13
- metadata +17 -4
- data/lib/memolog/formatter.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8cb342892f52d20fa06101e203aa4d4d1c5efea05696c48bb7a30804b66befb
|
4
|
+
data.tar.gz: 4e7f8721ae37487cc8d88316432d2897f269c1817e75d66e562c5b846521cbd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 806d71859e439c83417ad71f5c97f53358405e55243f982e79ce5f28b6736f1ae0175c6bf25822bbd30c27dea0f04584b4eb820df8ec8a8632c5487d48667a31
|
7
|
+
data.tar.gz: fbf2765dcf76597eba069a9d627e5728306043962bb92b3e23aab8e253cc948be10a4bbc4220b3d66bcb48d62ca3f9b9e362c88e03ea98a8f268dc51160b2926
|
data/.github/workflows/test.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,206 +1,225 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memolog (0.
|
4
|
+
memolog (0.4.0)
|
5
|
+
json (~> 2)
|
5
6
|
logger (~> 1.4.3)
|
6
7
|
securerandom (~> 0.1.0)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
13
|
-
activesupport (=
|
12
|
+
actioncable (7.0.1)
|
13
|
+
actionpack (= 7.0.1)
|
14
|
+
activesupport (= 7.0.1)
|
14
15
|
nio4r (~> 2.0)
|
15
16
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (
|
17
|
-
actionpack (=
|
18
|
-
activejob (=
|
19
|
-
activerecord (=
|
20
|
-
activestorage (=
|
21
|
-
activesupport (=
|
17
|
+
actionmailbox (7.0.1)
|
18
|
+
actionpack (= 7.0.1)
|
19
|
+
activejob (= 7.0.1)
|
20
|
+
activerecord (= 7.0.1)
|
21
|
+
activestorage (= 7.0.1)
|
22
|
+
activesupport (= 7.0.1)
|
22
23
|
mail (>= 2.7.1)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
net-imap
|
25
|
+
net-pop
|
26
|
+
net-smtp
|
27
|
+
actionmailer (7.0.1)
|
28
|
+
actionpack (= 7.0.1)
|
29
|
+
actionview (= 7.0.1)
|
30
|
+
activejob (= 7.0.1)
|
31
|
+
activesupport (= 7.0.1)
|
28
32
|
mail (~> 2.5, >= 2.5.4)
|
33
|
+
net-imap
|
34
|
+
net-pop
|
35
|
+
net-smtp
|
29
36
|
rails-dom-testing (~> 2.0)
|
30
|
-
actionpack (
|
31
|
-
actionview (=
|
32
|
-
activesupport (=
|
33
|
-
rack (~> 2.0, >= 2.0
|
37
|
+
actionpack (7.0.1)
|
38
|
+
actionview (= 7.0.1)
|
39
|
+
activesupport (= 7.0.1)
|
40
|
+
rack (~> 2.0, >= 2.2.0)
|
34
41
|
rack-test (>= 0.6.3)
|
35
42
|
rails-dom-testing (~> 2.0)
|
36
43
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
37
|
-
actiontext (
|
38
|
-
actionpack (=
|
39
|
-
activerecord (=
|
40
|
-
activestorage (=
|
41
|
-
activesupport (=
|
44
|
+
actiontext (7.0.1)
|
45
|
+
actionpack (= 7.0.1)
|
46
|
+
activerecord (= 7.0.1)
|
47
|
+
activestorage (= 7.0.1)
|
48
|
+
activesupport (= 7.0.1)
|
49
|
+
globalid (>= 0.6.0)
|
42
50
|
nokogiri (>= 1.8.5)
|
43
|
-
actionview (
|
44
|
-
activesupport (=
|
51
|
+
actionview (7.0.1)
|
52
|
+
activesupport (= 7.0.1)
|
45
53
|
builder (~> 3.1)
|
46
54
|
erubi (~> 1.4)
|
47
55
|
rails-dom-testing (~> 2.0)
|
48
56
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
49
|
-
activejob (
|
50
|
-
activesupport (=
|
57
|
+
activejob (7.0.1)
|
58
|
+
activesupport (= 7.0.1)
|
51
59
|
globalid (>= 0.3.6)
|
52
|
-
activemodel (
|
53
|
-
activesupport (=
|
54
|
-
activerecord (
|
55
|
-
activemodel (=
|
56
|
-
activesupport (=
|
57
|
-
activestorage (
|
58
|
-
actionpack (=
|
59
|
-
activejob (=
|
60
|
-
activerecord (=
|
61
|
-
activesupport (=
|
62
|
-
marcel (~> 1.0
|
60
|
+
activemodel (7.0.1)
|
61
|
+
activesupport (= 7.0.1)
|
62
|
+
activerecord (7.0.1)
|
63
|
+
activemodel (= 7.0.1)
|
64
|
+
activesupport (= 7.0.1)
|
65
|
+
activestorage (7.0.1)
|
66
|
+
actionpack (= 7.0.1)
|
67
|
+
activejob (= 7.0.1)
|
68
|
+
activerecord (= 7.0.1)
|
69
|
+
activesupport (= 7.0.1)
|
70
|
+
marcel (~> 1.0)
|
63
71
|
mini_mime (>= 1.1.0)
|
64
|
-
activesupport (
|
72
|
+
activesupport (7.0.1)
|
65
73
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
66
74
|
i18n (>= 1.6, < 2)
|
67
75
|
minitest (>= 5.1)
|
68
76
|
tzinfo (~> 2.0)
|
69
|
-
zeitwerk (~> 2.3)
|
70
77
|
ast (2.4.2)
|
71
78
|
builder (3.2.4)
|
72
79
|
coderay (1.1.3)
|
73
80
|
concurrent-ruby (1.1.9)
|
74
81
|
connection_pool (2.2.5)
|
75
82
|
crass (1.0.6)
|
76
|
-
diff-lcs (1.
|
83
|
+
diff-lcs (1.5.0)
|
84
|
+
digest (3.1.0)
|
77
85
|
erubi (1.10.0)
|
78
|
-
globalid (0.
|
86
|
+
globalid (1.0.0)
|
79
87
|
activesupport (>= 5.0)
|
80
|
-
i18n (1.
|
88
|
+
i18n (1.9.1)
|
81
89
|
concurrent-ruby (~> 1.0)
|
90
|
+
io-wait (0.2.1)
|
91
|
+
json (2.6.1)
|
82
92
|
logger (1.4.4)
|
83
|
-
loofah (2.
|
93
|
+
loofah (2.13.0)
|
84
94
|
crass (~> 1.0.2)
|
85
95
|
nokogiri (>= 1.5.9)
|
86
96
|
mail (2.7.1)
|
87
97
|
mini_mime (>= 0.1.1)
|
88
98
|
marcel (1.0.2)
|
89
99
|
method_source (1.0.0)
|
90
|
-
mini_mime (1.1.
|
91
|
-
minitest (5.
|
100
|
+
mini_mime (1.1.2)
|
101
|
+
minitest (5.15.0)
|
102
|
+
net-imap (0.2.3)
|
103
|
+
digest
|
104
|
+
net-protocol
|
105
|
+
strscan
|
106
|
+
net-pop (0.1.1)
|
107
|
+
digest
|
108
|
+
net-protocol
|
109
|
+
timeout
|
110
|
+
net-protocol (0.1.2)
|
111
|
+
io-wait
|
112
|
+
timeout
|
113
|
+
net-smtp (0.3.1)
|
114
|
+
digest
|
115
|
+
net-protocol
|
116
|
+
timeout
|
92
117
|
nio4r (2.5.8)
|
93
|
-
nokogiri (1.
|
118
|
+
nokogiri (1.13.1-x86_64-darwin)
|
94
119
|
racc (~> 1.4)
|
95
|
-
nokogiri (1.
|
120
|
+
nokogiri (1.13.1-x86_64-linux)
|
96
121
|
racc (~> 1.4)
|
97
122
|
parallel (1.21.0)
|
98
|
-
parser (3.0.
|
123
|
+
parser (3.1.0.0)
|
99
124
|
ast (~> 2.4.1)
|
100
125
|
pry (0.14.1)
|
101
126
|
coderay (~> 1.1)
|
102
127
|
method_source (~> 1.0)
|
103
|
-
racc (1.
|
128
|
+
racc (1.6.0)
|
104
129
|
rack (2.2.3)
|
105
130
|
rack-test (1.1.0)
|
106
131
|
rack (>= 1.0, < 3)
|
107
|
-
rails (
|
108
|
-
actioncable (=
|
109
|
-
actionmailbox (=
|
110
|
-
actionmailer (=
|
111
|
-
actionpack (=
|
112
|
-
actiontext (=
|
113
|
-
actionview (=
|
114
|
-
activejob (=
|
115
|
-
activemodel (=
|
116
|
-
activerecord (=
|
117
|
-
activestorage (=
|
118
|
-
activesupport (=
|
132
|
+
rails (7.0.1)
|
133
|
+
actioncable (= 7.0.1)
|
134
|
+
actionmailbox (= 7.0.1)
|
135
|
+
actionmailer (= 7.0.1)
|
136
|
+
actionpack (= 7.0.1)
|
137
|
+
actiontext (= 7.0.1)
|
138
|
+
actionview (= 7.0.1)
|
139
|
+
activejob (= 7.0.1)
|
140
|
+
activemodel (= 7.0.1)
|
141
|
+
activerecord (= 7.0.1)
|
142
|
+
activestorage (= 7.0.1)
|
143
|
+
activesupport (= 7.0.1)
|
119
144
|
bundler (>= 1.15.0)
|
120
|
-
railties (=
|
121
|
-
sprockets-rails (>= 2.0.0)
|
145
|
+
railties (= 7.0.1)
|
122
146
|
rails-dom-testing (2.0.3)
|
123
147
|
activesupport (>= 4.2.0)
|
124
148
|
nokogiri (>= 1.6)
|
125
149
|
rails-html-sanitizer (1.4.2)
|
126
150
|
loofah (~> 2.3)
|
127
|
-
railties (
|
128
|
-
actionpack (=
|
129
|
-
activesupport (=
|
151
|
+
railties (7.0.1)
|
152
|
+
actionpack (= 7.0.1)
|
153
|
+
activesupport (= 7.0.1)
|
130
154
|
method_source
|
131
|
-
rake (>=
|
155
|
+
rake (>= 12.2)
|
132
156
|
thor (~> 1.0)
|
133
|
-
|
157
|
+
zeitwerk (~> 2.5)
|
158
|
+
rainbow (3.1.1)
|
134
159
|
rake (13.0.6)
|
135
|
-
redis (4.
|
136
|
-
regexp_parser (2.
|
160
|
+
redis (4.6.0)
|
161
|
+
regexp_parser (2.2.0)
|
137
162
|
rexml (3.2.5)
|
138
163
|
rspec (3.10.0)
|
139
164
|
rspec-core (~> 3.10.0)
|
140
165
|
rspec-expectations (~> 3.10.0)
|
141
166
|
rspec-mocks (~> 3.10.0)
|
142
|
-
rspec-core (3.10.
|
167
|
+
rspec-core (3.10.2)
|
143
168
|
rspec-support (~> 3.10.0)
|
144
|
-
rspec-expectations (3.10.
|
169
|
+
rspec-expectations (3.10.2)
|
145
170
|
diff-lcs (>= 1.2.0, < 2.0)
|
146
171
|
rspec-support (~> 3.10.0)
|
147
|
-
rspec-mocks (3.10.
|
172
|
+
rspec-mocks (3.10.3)
|
148
173
|
diff-lcs (>= 1.2.0, < 2.0)
|
149
174
|
rspec-support (~> 3.10.0)
|
150
|
-
rspec-support (3.10.
|
151
|
-
rubocop (1.
|
175
|
+
rspec-support (3.10.3)
|
176
|
+
rubocop (1.25.1)
|
152
177
|
parallel (~> 1.10)
|
153
|
-
parser (>= 3.
|
178
|
+
parser (>= 3.1.0.0)
|
154
179
|
rainbow (>= 2.2.2, < 4.0)
|
155
180
|
regexp_parser (>= 1.8, < 3.0)
|
156
181
|
rexml
|
157
|
-
rubocop-ast (>= 1.
|
182
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
158
183
|
ruby-progressbar (~> 1.7)
|
159
184
|
unicode-display_width (>= 1.4.0, < 3.0)
|
160
|
-
rubocop-ast (1.
|
185
|
+
rubocop-ast (1.15.1)
|
161
186
|
parser (>= 3.0.1.1)
|
162
|
-
rubocop-config-umbrellio (1.
|
163
|
-
rubocop (
|
164
|
-
rubocop-performance (
|
165
|
-
rubocop-rails (
|
166
|
-
rubocop-rake (
|
167
|
-
rubocop-rspec (
|
168
|
-
rubocop-sequel (
|
169
|
-
rubocop-performance (1.
|
170
|
-
rubocop (>=
|
187
|
+
rubocop-config-umbrellio (1.25.0.61)
|
188
|
+
rubocop (~> 1.25.0)
|
189
|
+
rubocop-performance (~> 1.13.0)
|
190
|
+
rubocop-rails (~> 2.13.0)
|
191
|
+
rubocop-rake (~> 0.6.0)
|
192
|
+
rubocop-rspec (~> 2.7.0)
|
193
|
+
rubocop-sequel (~> 0.3.3)
|
194
|
+
rubocop-performance (1.13.2)
|
195
|
+
rubocop (>= 1.7.0, < 2.0)
|
171
196
|
rubocop-ast (>= 0.4.0)
|
172
|
-
rubocop-rails (2.
|
197
|
+
rubocop-rails (2.13.2)
|
173
198
|
activesupport (>= 4.2.0)
|
174
199
|
rack (>= 1.1)
|
175
|
-
rubocop (>=
|
176
|
-
rubocop-rake (0.
|
177
|
-
rubocop
|
178
|
-
rubocop-rspec (2.2.0)
|
200
|
+
rubocop (>= 1.7.0, < 2.0)
|
201
|
+
rubocop-rake (0.6.0)
|
179
202
|
rubocop (~> 1.0)
|
180
|
-
|
181
|
-
|
203
|
+
rubocop-rspec (2.7.0)
|
204
|
+
rubocop (~> 1.19)
|
205
|
+
rubocop-sequel (0.3.3)
|
182
206
|
rubocop (~> 1.0)
|
183
207
|
ruby-progressbar (1.11.0)
|
184
208
|
securerandom (0.1.1)
|
185
|
-
sidekiq (6.
|
209
|
+
sidekiq (6.4.1)
|
186
210
|
connection_pool (>= 2.2.2)
|
187
211
|
rack (~> 2.0)
|
188
212
|
redis (>= 4.2.0)
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
sprockets-rails (3.2.2)
|
193
|
-
actionpack (>= 4.0)
|
194
|
-
activesupport (>= 4.0)
|
195
|
-
sprockets (>= 3.0.0)
|
196
|
-
thor (1.1.0)
|
213
|
+
strscan (3.0.1)
|
214
|
+
thor (1.2.1)
|
215
|
+
timeout (0.2.0)
|
197
216
|
tzinfo (2.0.4)
|
198
217
|
concurrent-ruby (~> 1.0)
|
199
218
|
unicode-display_width (2.1.0)
|
200
219
|
websocket-driver (0.7.5)
|
201
220
|
websocket-extensions (>= 0.1.0)
|
202
221
|
websocket-extensions (0.1.5)
|
203
|
-
zeitwerk (2.4
|
222
|
+
zeitwerk (2.5.4)
|
204
223
|
|
205
224
|
PLATFORMS
|
206
225
|
x86_64-darwin-20
|
data/README.md
CHANGED
@@ -26,21 +26,28 @@ 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 = ::
|
30
|
-
config.
|
29
|
+
config.formatter = ::Logger::Formatter.new
|
30
|
+
config.middlewares = %i[rails sidekiq]
|
31
|
+
config.log_json = false
|
31
32
|
config.log_size_limit = 50_000
|
32
|
-
config.uuid_callable = -> { SecureRandom.uuid }
|
33
33
|
end
|
34
34
|
|
35
|
-
Memolog.
|
35
|
+
Memolog.init_middlewares!
|
36
36
|
```
|
37
37
|
|
38
38
|
Available options are:
|
39
39
|
- `debug` - set it to true if you need to leave Memolog.dump result outside `Memolog.run {}` block.
|
40
40
|
- `formatter` - setup your own formatter.
|
41
|
-
- `
|
41
|
+
- `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`
|
42
43
|
- `log_size_limit` - max log length in `#dump`.
|
43
|
-
|
44
|
+
|
45
|
+
If you want to apply Sentry monkey patch that call `Memolog.dump` before `Sentry.capture_exception`
|
46
|
+
and `Sentry.capture_message` you can implement it via this code:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
Sentry.prepend(Memolog::SentryExtension)
|
50
|
+
```
|
44
51
|
|
45
52
|
## Usage
|
46
53
|
|
data/lib/memolog/config.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
Memolog::Config = Struct.new(
|
4
4
|
:debug,
|
5
5
|
:formatter,
|
6
|
-
:
|
6
|
+
:middlewares,
|
7
|
+
:parse_json,
|
7
8
|
:log_size_limit,
|
8
|
-
:uuid_callable,
|
9
9
|
) do
|
10
10
|
def initialize
|
11
11
|
self.debug = false
|
12
|
-
self.formatter = ::
|
13
|
-
self.
|
12
|
+
self.formatter = ::Logger::Formatter.new
|
13
|
+
self.middlewares = %i[rails sidekiq]
|
14
|
+
self.parse_json = false
|
14
15
|
self.log_size_limit = 50_000
|
15
|
-
self.uuid_callable = -> { SecureRandom.uuid }
|
16
16
|
end
|
17
17
|
end
|
data/lib/memolog/init.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module Memolog::Init
|
4
|
+
extend self
|
5
|
+
|
6
|
+
def init_middlewares!
|
5
7
|
init_rails_middleware!
|
6
8
|
init_sidekiq_middleware!
|
7
9
|
end
|
8
10
|
|
9
|
-
private
|
10
|
-
|
11
11
|
def init_rails_middleware!
|
12
|
-
return unless Memolog.config.
|
13
|
-
return unless Object.const_defined?(
|
14
|
-
return if Object.const_defined?(
|
12
|
+
return unless Memolog.config.middlewares.include?(:rails)
|
13
|
+
return unless Object.const_defined?(:Rails)
|
14
|
+
return if Object.const_defined?(:Sidekiq) && Sidekiq.server?
|
15
15
|
|
16
16
|
Rails.application.middleware.insert_before(0, Memolog::RailsMiddleware)
|
17
17
|
end
|
18
18
|
|
19
19
|
def init_sidekiq_middleware!
|
20
|
-
return unless Memolog.config.
|
21
|
-
return unless Object.const_defined?(
|
20
|
+
return unless Memolog.config.middlewares.include?(:sidekiq)
|
21
|
+
return unless Object.const_defined?(:Sidekiq)
|
22
22
|
|
23
23
|
Sidekiq.configure_server do |config|
|
24
24
|
config.server_middleware do |chain|
|
data/lib/memolog/version.rb
CHANGED
data/lib/memolog.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
require "logger"
|
4
4
|
require "securerandom"
|
5
5
|
require "stringio"
|
6
|
+
require "json"
|
6
7
|
|
7
8
|
require "memolog/version"
|
8
9
|
require "memolog/config"
|
9
|
-
require "memolog/extension"
|
10
|
-
require "memolog/formatter"
|
11
10
|
require "memolog/init"
|
11
|
+
require "memolog/logger_extension"
|
12
12
|
require "memolog/rails_middleware"
|
13
13
|
require "memolog/sentry_extension"
|
14
14
|
require "memolog/sidekiq_middleware"
|
@@ -24,17 +24,12 @@ module Memolog
|
|
24
24
|
yield(config) if block_given?
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
Memolog::Init.
|
27
|
+
def init_middlewares!
|
28
|
+
Memolog::Init.init_middlewares!
|
29
29
|
end
|
30
30
|
|
31
31
|
def extend_logger(other_logger)
|
32
|
-
other_logger.extend(Memolog::
|
33
|
-
other_logger.formatter = config.formatter
|
34
|
-
end
|
35
|
-
|
36
|
-
def uuid
|
37
|
-
Thread.current[:memolog_uuid]
|
32
|
+
other_logger.extend(Memolog::LoggerExtension)
|
38
33
|
end
|
39
34
|
|
40
35
|
def logger
|
@@ -46,8 +41,6 @@ module Memolog
|
|
46
41
|
end
|
47
42
|
|
48
43
|
def run
|
49
|
-
Thread.current[:memolog_uuid] = config.uuid_callable.call
|
50
|
-
|
51
44
|
logdevs.push(StringIO.new)
|
52
45
|
logger.instance_variable_set(:@logdev, logdevs.last)
|
53
46
|
|
@@ -62,6 +55,10 @@ module Memolog
|
|
62
55
|
beginning = logdevs.last.string.length - config.log_size_limit
|
63
56
|
beginning = 0 if beginning.negative?
|
64
57
|
|
65
|
-
logdevs.last.string.slice(beginning, config.log_size_limit).presence
|
58
|
+
dump = logdevs.last.string.slice(beginning, config.log_size_limit).presence
|
59
|
+
|
60
|
+
config.parse_json ? JSON.parse(dump) : dump
|
61
|
+
rescue JSON::ParserError
|
62
|
+
dump
|
66
63
|
end
|
67
64
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memolog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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:
|
11
|
+
date: 2022-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: logger
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,9 +75,8 @@ files:
|
|
61
75
|
- bin/setup
|
62
76
|
- lib/memolog.rb
|
63
77
|
- lib/memolog/config.rb
|
64
|
-
- lib/memolog/extension.rb
|
65
|
-
- lib/memolog/formatter.rb
|
66
78
|
- lib/memolog/init.rb
|
79
|
+
- lib/memolog/logger_extension.rb
|
67
80
|
- lib/memolog/rails_middleware.rb
|
68
81
|
- lib/memolog/sentry_extension.rb
|
69
82
|
- lib/memolog/sidekiq_middleware.rb
|
data/lib/memolog/formatter.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Memolog::Formatter < Logger::Formatter
|
4
|
-
def call(severity, time, _progname, msg)
|
5
|
-
format(
|
6
|
-
Format,
|
7
|
-
severity[0..0],
|
8
|
-
format_datetime(time),
|
9
|
-
$PID,
|
10
|
-
severity,
|
11
|
-
Memolog.uuid,
|
12
|
-
msg2str(msg),
|
13
|
-
)
|
14
|
-
end
|
15
|
-
end
|