markdown_logging_proxy 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/dist/markdown_logging_proxy.rb +8 -11
- data/lib/markdown_logging_proxy/proxy.rb +2 -7
- data/lib/markdown_logging_proxy/tracer.rb +6 -4
- data/markdown_logging_proxy.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a597efa8e2dab27f1fe61005c367d1cfbabd2e1ea5a03e03ec1b29d2baab02
|
4
|
+
data.tar.gz: f76c90d59eb9c1a911c6eeb2c3e1e2bb8ec881847d9bf8d9cadb0a53ae3378fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 108a3acc43c38e7a9fad4773a5d2f2b7b9c55e33b1f6280869316affe6d8b48d342ada65cb170865f672a6f1a77f184a171ccdc6720ebe9c41d5bae8af5ed590
|
7
|
+
data.tar.gz: 9a696b09265a340d4934c4874cbe0e0977cd6739768d282f145255b128126cdac879e921de452addffa1b94b980dce0d7039d397babd978a179e70b70c09d5aa
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -86,13 +86,8 @@ module MarkdownLoggingProxy
|
|
86
86
|
end
|
87
87
|
module MarkdownLoggingProxy
|
88
88
|
class Proxy
|
89
|
-
|
90
|
-
DEFAULT_OVERWRITES =
|
91
|
-
! != !~ <=> == === =~
|
92
|
-
clone display dup enum_for eql? equal? freeze frozen? hash inspect
|
93
|
-
is_a? itself kind_of? nil? taint tainted? tap then to_enum to_s
|
94
|
-
trust untaint unstrust untrusted? yield_self
|
95
|
-
]
|
89
|
+
DO_NOT_OVERWRITE = %i[__binding__ __id__ __send__ class extend]
|
90
|
+
DEFAULT_OVERWRITES = Object.new.methods - DO_NOT_OVERWRITE
|
96
91
|
|
97
92
|
def initialize(
|
98
93
|
to_proxy = nil,
|
@@ -205,16 +200,18 @@ module MarkdownLoggingProxy
|
|
205
200
|
|
206
201
|
def log_and_proxy_block(meth, blk)
|
207
202
|
return if blk.nil?
|
203
|
+
logger_ref = self.logger
|
204
|
+
target_ref = self.target
|
208
205
|
proc do |*args|
|
209
|
-
|
210
|
-
Yield to block in `#{meth}` on #{MarkdownLogger.id_object(
|
206
|
+
logger_ref.log :info, 2, <<~MSG.chomp
|
207
|
+
Yield to block in `#{meth}` on #{MarkdownLogger.id_object(target_ref)}
|
211
208
|
|
212
209
|
Arguments:
|
213
210
|
|
214
211
|
#{MarkdownLogger.inspect_object(args, false)}
|
215
212
|
MSG
|
216
|
-
|
217
|
-
|
213
|
+
instance_exec(*args, &blk).tap do |response|
|
214
|
+
logger_ref.log :info, 3, <<~MSG.chomp
|
218
215
|
Response from block in `#{meth}`
|
219
216
|
|
220
217
|
#{MarkdownLogger.inspect_object(response)}
|
@@ -1,12 +1,7 @@
|
|
1
1
|
module MarkdownLoggingProxy
|
2
2
|
class Proxy
|
3
|
-
|
4
|
-
DEFAULT_OVERWRITES =
|
5
|
-
! != !~ <=> == === =~
|
6
|
-
clone display dup enum_for eql? equal? freeze frozen? hash inspect
|
7
|
-
is_a? itself kind_of? nil? taint tainted? tap then to_enum to_s
|
8
|
-
trust untaint unstrust untrusted? yield_self
|
9
|
-
]
|
3
|
+
DO_NOT_OVERWRITE = %i[__binding__ __id__ __send__ class extend]
|
4
|
+
DEFAULT_OVERWRITES = Object.new.methods - DO_NOT_OVERWRITE
|
10
5
|
|
11
6
|
def initialize(
|
12
7
|
to_proxy = nil,
|
@@ -75,16 +75,18 @@ module MarkdownLoggingProxy
|
|
75
75
|
|
76
76
|
def log_and_proxy_block(meth, blk)
|
77
77
|
return if blk.nil?
|
78
|
+
logger_ref = self.logger
|
79
|
+
target_ref = self.target
|
78
80
|
proc do |*args|
|
79
|
-
|
80
|
-
Yield to block in `#{meth}` on #{MarkdownLogger.id_object(
|
81
|
+
logger_ref.log :info, 2, <<~MSG.chomp
|
82
|
+
Yield to block in `#{meth}` on #{MarkdownLogger.id_object(target_ref)}
|
81
83
|
|
82
84
|
Arguments:
|
83
85
|
|
84
86
|
#{MarkdownLogger.inspect_object(args, false)}
|
85
87
|
MSG
|
86
|
-
|
87
|
-
|
88
|
+
instance_exec(*args, &blk).tap do |response|
|
89
|
+
logger_ref.log :info, 3, <<~MSG.chomp
|
88
90
|
Response from block in `#{meth}`
|
89
91
|
|
90
92
|
#{MarkdownLogger.inspect_object(response)}
|