memolog 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +60 -60
- data/lib/memolog/config.rb +4 -2
- data/lib/memolog/logger_extension.rb +2 -2
- data/lib/memolog/version.rb +1 -1
- data/lib/memolog.rb +18 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26a1f1133c9b055600c33a91d7c53f59adb80c6d4965d655a5202114d69f770b
|
4
|
+
data.tar.gz: bce4c804aec15718d38cb9e73ce9866861676dfa2f2c59d9c3c50e6dd67330de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ba992c3aae9358737c56c3154d1ebf88007abb26e8b8bcc8225e9a2d9cbc500c01e63b9de6cb4e456e79e067692d36988b87dc30f78fee8ed4abc04f9977ccd
|
7
|
+
data.tar.gz: 7c757c5e1b80e846434acc435f4bd5141f483d5c056cb10b837977b62a8acc7795ce5e00bcd6e120a0514c035b6d6dd5cc7d4fe5c586e3831c4b5656362fe30e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memolog (0.5.
|
4
|
+
memolog (0.5.2)
|
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.
|
13
|
-
actionpack (= 7.0.
|
14
|
-
activesupport (= 7.0.
|
12
|
+
actioncable (7.0.8)
|
13
|
+
actionpack (= 7.0.8)
|
14
|
+
activesupport (= 7.0.8)
|
15
15
|
nio4r (~> 2.0)
|
16
16
|
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailbox (7.0.
|
18
|
-
actionpack (= 7.0.
|
19
|
-
activejob (= 7.0.
|
20
|
-
activerecord (= 7.0.
|
21
|
-
activestorage (= 7.0.
|
22
|
-
activesupport (= 7.0.
|
17
|
+
actionmailbox (7.0.8)
|
18
|
+
actionpack (= 7.0.8)
|
19
|
+
activejob (= 7.0.8)
|
20
|
+
activerecord (= 7.0.8)
|
21
|
+
activestorage (= 7.0.8)
|
22
|
+
activesupport (= 7.0.8)
|
23
23
|
mail (>= 2.7.1)
|
24
24
|
net-imap
|
25
25
|
net-pop
|
26
26
|
net-smtp
|
27
|
-
actionmailer (7.0.
|
28
|
-
actionpack (= 7.0.
|
29
|
-
actionview (= 7.0.
|
30
|
-
activejob (= 7.0.
|
31
|
-
activesupport (= 7.0.
|
27
|
+
actionmailer (7.0.8)
|
28
|
+
actionpack (= 7.0.8)
|
29
|
+
actionview (= 7.0.8)
|
30
|
+
activejob (= 7.0.8)
|
31
|
+
activesupport (= 7.0.8)
|
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.
|
38
|
-
actionview (= 7.0.
|
39
|
-
activesupport (= 7.0.
|
37
|
+
actionpack (7.0.8)
|
38
|
+
actionview (= 7.0.8)
|
39
|
+
activesupport (= 7.0.8)
|
40
40
|
rack (~> 2.0, >= 2.2.4)
|
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.
|
45
|
-
actionpack (= 7.0.
|
46
|
-
activerecord (= 7.0.
|
47
|
-
activestorage (= 7.0.
|
48
|
-
activesupport (= 7.0.
|
44
|
+
actiontext (7.0.8)
|
45
|
+
actionpack (= 7.0.8)
|
46
|
+
activerecord (= 7.0.8)
|
47
|
+
activestorage (= 7.0.8)
|
48
|
+
activesupport (= 7.0.8)
|
49
49
|
globalid (>= 0.6.0)
|
50
50
|
nokogiri (>= 1.8.5)
|
51
|
-
actionview (7.0.
|
52
|
-
activesupport (= 7.0.
|
51
|
+
actionview (7.0.8)
|
52
|
+
activesupport (= 7.0.8)
|
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.
|
58
|
-
activesupport (= 7.0.
|
57
|
+
activejob (7.0.8)
|
58
|
+
activesupport (= 7.0.8)
|
59
59
|
globalid (>= 0.3.6)
|
60
|
-
activemodel (7.0.
|
61
|
-
activesupport (= 7.0.
|
62
|
-
activerecord (7.0.
|
63
|
-
activemodel (= 7.0.
|
64
|
-
activesupport (= 7.0.
|
65
|
-
activestorage (7.0.
|
66
|
-
actionpack (= 7.0.
|
67
|
-
activejob (= 7.0.
|
68
|
-
activerecord (= 7.0.
|
69
|
-
activesupport (= 7.0.
|
60
|
+
activemodel (7.0.8)
|
61
|
+
activesupport (= 7.0.8)
|
62
|
+
activerecord (7.0.8)
|
63
|
+
activemodel (= 7.0.8)
|
64
|
+
activesupport (= 7.0.8)
|
65
|
+
activestorage (7.0.8)
|
66
|
+
actionpack (= 7.0.8)
|
67
|
+
activejob (= 7.0.8)
|
68
|
+
activerecord (= 7.0.8)
|
69
|
+
activesupport (= 7.0.8)
|
70
70
|
marcel (~> 1.0)
|
71
71
|
mini_mime (>= 1.1.0)
|
72
|
-
activesupport (7.0.
|
72
|
+
activesupport (7.0.8)
|
73
73
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
74
74
|
i18n (>= 1.6, < 2)
|
75
75
|
minitest (>= 5.1)
|
@@ -100,7 +100,7 @@ GEM
|
|
100
100
|
marcel (1.0.2)
|
101
101
|
method_source (1.0.0)
|
102
102
|
mini_mime (1.1.5)
|
103
|
-
minitest (5.
|
103
|
+
minitest (5.20.0)
|
104
104
|
net-imap (0.3.7)
|
105
105
|
date
|
106
106
|
net-protocol
|
@@ -108,7 +108,7 @@ GEM
|
|
108
108
|
net-protocol
|
109
109
|
net-protocol (0.2.1)
|
110
110
|
timeout
|
111
|
-
net-smtp (0.
|
111
|
+
net-smtp (0.4.0)
|
112
112
|
net-protocol
|
113
113
|
nio4r (2.5.9)
|
114
114
|
nokogiri (1.15.4-arm64-darwin)
|
@@ -128,20 +128,20 @@ GEM
|
|
128
128
|
rack (2.2.8)
|
129
129
|
rack-test (2.1.0)
|
130
130
|
rack (>= 1.3)
|
131
|
-
rails (7.0.
|
132
|
-
actioncable (= 7.0.
|
133
|
-
actionmailbox (= 7.0.
|
134
|
-
actionmailer (= 7.0.
|
135
|
-
actionpack (= 7.0.
|
136
|
-
actiontext (= 7.0.
|
137
|
-
actionview (= 7.0.
|
138
|
-
activejob (= 7.0.
|
139
|
-
activemodel (= 7.0.
|
140
|
-
activerecord (= 7.0.
|
141
|
-
activestorage (= 7.0.
|
142
|
-
activesupport (= 7.0.
|
131
|
+
rails (7.0.8)
|
132
|
+
actioncable (= 7.0.8)
|
133
|
+
actionmailbox (= 7.0.8)
|
134
|
+
actionmailer (= 7.0.8)
|
135
|
+
actionpack (= 7.0.8)
|
136
|
+
actiontext (= 7.0.8)
|
137
|
+
actionview (= 7.0.8)
|
138
|
+
activejob (= 7.0.8)
|
139
|
+
activemodel (= 7.0.8)
|
140
|
+
activerecord (= 7.0.8)
|
141
|
+
activestorage (= 7.0.8)
|
142
|
+
activesupport (= 7.0.8)
|
143
143
|
bundler (>= 1.15.0)
|
144
|
-
railties (= 7.0.
|
144
|
+
railties (= 7.0.8)
|
145
145
|
rails-dom-testing (2.2.0)
|
146
146
|
activesupport (>= 5.0.0)
|
147
147
|
minitest
|
@@ -149,9 +149,9 @@ GEM
|
|
149
149
|
rails-html-sanitizer (1.6.0)
|
150
150
|
loofah (~> 2.21)
|
151
151
|
nokogiri (~> 1.14)
|
152
|
-
railties (7.0.
|
153
|
-
actionpack (= 7.0.
|
154
|
-
activesupport (= 7.0.
|
152
|
+
railties (7.0.8)
|
153
|
+
actionpack (= 7.0.8)
|
154
|
+
activesupport (= 7.0.8)
|
155
155
|
method_source
|
156
156
|
rake (>= 12.2)
|
157
157
|
thor (~> 1.0)
|
@@ -187,7 +187,7 @@ GEM
|
|
187
187
|
unicode-display_width (>= 2.4.0, < 3.0)
|
188
188
|
rubocop-ast (1.29.0)
|
189
189
|
parser (>= 3.2.1.0)
|
190
|
-
rubocop-capybara (2.
|
190
|
+
rubocop-capybara (2.19.0)
|
191
191
|
rubocop (~> 1.41)
|
192
192
|
rubocop-config-umbrellio (1.50.0.85)
|
193
193
|
rubocop (~> 1.50.0)
|
@@ -212,7 +212,7 @@ GEM
|
|
212
212
|
rubocop (~> 1.0)
|
213
213
|
ruby-progressbar (1.13.0)
|
214
214
|
securerandom (0.1.1)
|
215
|
-
sidekiq (7.1.
|
215
|
+
sidekiq (7.1.5)
|
216
216
|
concurrent-ruby (< 2)
|
217
217
|
connection_pool (>= 2.3.0)
|
218
218
|
rack (>= 2.2.4)
|
@@ -221,11 +221,11 @@ GEM
|
|
221
221
|
timeout (0.4.0)
|
222
222
|
tzinfo (2.0.6)
|
223
223
|
concurrent-ruby (~> 1.0)
|
224
|
-
unicode-display_width (2.
|
224
|
+
unicode-display_width (2.5.0)
|
225
225
|
websocket-driver (0.7.6)
|
226
226
|
websocket-extensions (>= 0.1.0)
|
227
227
|
websocket-extensions (0.1.5)
|
228
|
-
zeitwerk (2.6.
|
228
|
+
zeitwerk (2.6.12)
|
229
229
|
|
230
230
|
PLATFORMS
|
231
231
|
arm64-darwin-22
|
data/lib/memolog/config.rb
CHANGED
@@ -3,13 +3,15 @@
|
|
3
3
|
Memolog::Config = Struct.new(
|
4
4
|
:debug,
|
5
5
|
:formatter,
|
6
|
-
:
|
6
|
+
:isolation_level,
|
7
7
|
:log_size_limit,
|
8
|
+
:middlewares,
|
8
9
|
) do
|
9
10
|
def initialize
|
10
11
|
self.debug = false
|
11
12
|
self.formatter = Logger::Formatter.new
|
12
|
-
self.
|
13
|
+
self.isolation_level = :thread
|
13
14
|
self.log_size_limit = 50_000
|
15
|
+
self.middlewares = %i[rails sidekiq]
|
14
16
|
end
|
15
17
|
end
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
module Memolog::LoggerExtension
|
4
4
|
def add(*args, &block)
|
5
|
-
Memolog.
|
5
|
+
Memolog.log(*args, &block)
|
6
6
|
super
|
7
7
|
end
|
8
8
|
|
9
9
|
def log(*args, &block)
|
10
|
-
Memolog.
|
10
|
+
Memolog.log(*args, &block)
|
11
11
|
super
|
12
12
|
end
|
13
13
|
end
|
data/lib/memolog/version.rb
CHANGED
data/lib/memolog.rb
CHANGED
@@ -31,14 +31,6 @@ module Memolog
|
|
31
31
|
other_logger.extend(Memolog::LoggerExtension)
|
32
32
|
end
|
33
33
|
|
34
|
-
def logger
|
35
|
-
Thread.current[:memolog_logger] ||= Logger.new(nil, formatter: config.formatter)
|
36
|
-
end
|
37
|
-
|
38
|
-
def logdevs
|
39
|
-
Thread.current[:memolog_logdevs] ||= []
|
40
|
-
end
|
41
|
-
|
42
34
|
def run
|
43
35
|
logdevs.push(StringIO.new)
|
44
36
|
logger.instance_variable_set(:@logdev, logdevs.last)
|
@@ -48,6 +40,10 @@ module Memolog
|
|
48
40
|
logdevs.pop unless config.debug
|
49
41
|
end
|
50
42
|
|
43
|
+
def log(*args, &block)
|
44
|
+
logger.log(*args, &block)
|
45
|
+
end
|
46
|
+
|
51
47
|
def dump(parse_json: false)
|
52
48
|
return if logdevs.empty?
|
53
49
|
|
@@ -60,4 +56,18 @@ module Memolog
|
|
60
56
|
rescue JSON::ParserError
|
61
57
|
dump
|
62
58
|
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def logger
|
63
|
+
storage[:memolog_logger] ||= Logger.new(nil, formatter: config.formatter)
|
64
|
+
end
|
65
|
+
|
66
|
+
def logdevs
|
67
|
+
storage[:memolog_logdevs] ||= []
|
68
|
+
end
|
69
|
+
|
70
|
+
def storage
|
71
|
+
config.isolation_level == :fiber ? Fiber : Thread.current
|
72
|
+
end
|
63
73
|
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.5.
|
4
|
+
version: 0.5.2
|
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-
|
11
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|