debug_logging 3.1.1 → 3.1.2
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 +4 -4
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +97 -63
- data/.travis.yml +2 -2
- data/README.md +67 -25
- data/debug_logging.gemspec +5 -2
- data/lib/debug_logging/argument_printer.rb +1 -1
- data/lib/debug_logging/configuration.rb +2 -2
- data/lib/debug_logging/version.rb +1 -1
- metadata +49 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb9df42efa08fe95b6c9270a4474132b2dbb55ed8d154d17c20dfde074781a8c
|
|
4
|
+
data.tar.gz: 459f277689fcb9b328b4c904730ae25bfe1c55fc87a5ab292157393f6b13c36b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5af7096cfbadcea5695cc19bdce85e4d6ac8eecf02139378cb2dc0d734d99011bc49ff239fe1d816ce9570a883b75b4f6e0772fdfbf7feda147e7890c56d415a
|
|
7
|
+
data.tar.gz: f471d3858ad20c1d3347b4ce328254c01572da54fd0e566ccbf6b15827996c561cf86c5fcb23f14ad127d5a9449b045c63281768c082b2375d754e566f3d4561
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,89 +1,134 @@
|
|
|
1
|
-
inherit_from: .rubocop.yml
|
|
2
|
-
|
|
3
1
|
# This configuration was generated by
|
|
4
2
|
# `rubocop --auto-gen-config`
|
|
5
|
-
# on 2020-10
|
|
3
|
+
# on 2020-12-10 04:35:55 UTC using RuboCop version 1.6.0.
|
|
6
4
|
# The point is for the user to remove these configuration records
|
|
7
5
|
# one by one as the offenses are removed from the code base.
|
|
8
6
|
# Note that changes in the inspected code, or installation of new
|
|
9
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
10
8
|
|
|
11
|
-
# Offense count:
|
|
12
|
-
|
|
13
|
-
# Include: **/*.gemspec
|
|
14
|
-
Gemspec/RequiredRubyVersion:
|
|
9
|
+
# Offense count: 7
|
|
10
|
+
Lint/DuplicateMethods:
|
|
15
11
|
Exclude:
|
|
16
|
-
- '
|
|
17
|
-
|
|
18
|
-
# Offense count: 1
|
|
19
|
-
# Cop supports --auto-correct.
|
|
20
|
-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
|
21
|
-
# SupportedStyles: space, no_space
|
|
22
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
|
23
|
-
Layout/SpaceInsideBlockBraces:
|
|
24
|
-
Exclude:
|
|
25
|
-
- 'lib/debug_logging/argument_printer.rb'
|
|
12
|
+
- 'README.md'
|
|
26
13
|
|
|
27
|
-
# Offense count:
|
|
28
|
-
# Configuration parameters: IgnoredMethods.
|
|
14
|
+
# Offense count: 6
|
|
15
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
|
29
16
|
Metrics/AbcSize:
|
|
30
|
-
Max:
|
|
17
|
+
Max: 96
|
|
31
18
|
|
|
32
|
-
# Offense count:
|
|
33
|
-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
|
|
34
|
-
#
|
|
19
|
+
# Offense count: 58
|
|
20
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
21
|
+
# IgnoredMethods: refine
|
|
35
22
|
Metrics/BlockLength:
|
|
36
|
-
Max:
|
|
23
|
+
Max: 851
|
|
37
24
|
|
|
38
25
|
# Offense count: 6
|
|
39
26
|
# Configuration parameters: CountBlocks.
|
|
40
27
|
Metrics/BlockNesting:
|
|
41
28
|
Max: 4
|
|
42
29
|
|
|
43
|
-
# Offense count: 1
|
|
44
|
-
# Configuration parameters: CountComments, CountAsOne.
|
|
45
|
-
Metrics/ClassLength:
|
|
46
|
-
Max: 101
|
|
47
|
-
|
|
48
30
|
# Offense count: 4
|
|
49
31
|
# Configuration parameters: IgnoredMethods.
|
|
50
32
|
Metrics/CyclomaticComplexity:
|
|
51
|
-
Max:
|
|
33
|
+
Max: 24
|
|
52
34
|
|
|
53
|
-
# Offense count:
|
|
54
|
-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
|
|
35
|
+
# Offense count: 15
|
|
36
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
55
37
|
Metrics/MethodLength:
|
|
56
|
-
Max:
|
|
38
|
+
Max: 75
|
|
57
39
|
|
|
58
|
-
# Offense count:
|
|
40
|
+
# Offense count: 2
|
|
59
41
|
# Configuration parameters: CountComments, CountAsOne.
|
|
60
42
|
Metrics/ModuleLength:
|
|
61
43
|
Max: 112
|
|
62
44
|
|
|
63
|
-
# Offense count:
|
|
45
|
+
# Offense count: 5
|
|
64
46
|
# Configuration parameters: IgnoredMethods.
|
|
65
47
|
Metrics/PerceivedComplexity:
|
|
66
|
-
Max:
|
|
48
|
+
Max: 31
|
|
67
49
|
|
|
68
|
-
# Offense count:
|
|
69
|
-
# Configuration parameters:
|
|
70
|
-
|
|
50
|
+
# Offense count: 3
|
|
51
|
+
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
|
52
|
+
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
|
53
|
+
Naming/MemoizedInstanceVariableName:
|
|
71
54
|
Exclude:
|
|
72
55
|
- 'lib/debug_logging/configuration.rb'
|
|
73
56
|
|
|
57
|
+
# Offense count: 60
|
|
58
|
+
# Configuration parameters: Prefixes.
|
|
59
|
+
# Prefixes: when, with, without
|
|
60
|
+
RSpec/ContextWording:
|
|
61
|
+
Exclude:
|
|
62
|
+
- 'spec/debug_logging/class_logger_spec.rb'
|
|
63
|
+
- 'spec/debug_logging/class_notifier_spec.rb'
|
|
64
|
+
- 'spec/debug_logging/configuration_spec.rb'
|
|
65
|
+
- 'spec/debug_logging/instance_logger_spec.rb'
|
|
66
|
+
- 'spec/debug_logging/instance_notifier_spec.rb'
|
|
67
|
+
- 'spec/debug_logging_spec.rb'
|
|
68
|
+
|
|
69
|
+
# Offense count: 46
|
|
70
|
+
# Configuration parameters: Max.
|
|
71
|
+
RSpec/ExampleLength:
|
|
72
|
+
Exclude:
|
|
73
|
+
- 'spec/debug_logging/class_logger_spec.rb'
|
|
74
|
+
- 'spec/debug_logging/class_notifier_spec.rb'
|
|
75
|
+
- 'spec/debug_logging/configuration_spec.rb'
|
|
76
|
+
- 'spec/debug_logging/instance_logger_spec.rb'
|
|
77
|
+
- 'spec/debug_logging/instance_notifier_spec.rb'
|
|
78
|
+
- 'spec/debug_logging/log_subscriber_spec.rb'
|
|
79
|
+
- 'spec/debug_logging_spec.rb'
|
|
80
|
+
|
|
81
|
+
# Offense count: 53
|
|
82
|
+
# Configuration parameters: AssignmentOnly.
|
|
83
|
+
RSpec/InstanceVariable:
|
|
84
|
+
Exclude:
|
|
85
|
+
- 'spec/debug_logging/class_notifier_spec.rb'
|
|
86
|
+
- 'spec/debug_logging/instance_notifier_spec.rb'
|
|
87
|
+
- 'spec/debug_logging/log_subscriber_spec.rb'
|
|
88
|
+
|
|
89
|
+
# Offense count: 4
|
|
90
|
+
RSpec/LeakyConstantDeclaration:
|
|
91
|
+
Exclude:
|
|
92
|
+
- 'spec/debug_logging/configuration_spec.rb'
|
|
93
|
+
|
|
94
|
+
# Offense count: 23
|
|
95
|
+
# Configuration parameters: .
|
|
96
|
+
# SupportedStyles: have_received, receive
|
|
97
|
+
RSpec/MessageSpies:
|
|
98
|
+
EnforcedStyle: receive
|
|
99
|
+
|
|
100
|
+
# Offense count: 80
|
|
101
|
+
RSpec/MultipleExpectations:
|
|
102
|
+
Max: 32
|
|
103
|
+
|
|
74
104
|
# Offense count: 1
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
# Configuration parameters: AllowSubject.
|
|
106
|
+
RSpec/MultipleMemoizedHelpers:
|
|
107
|
+
Max: 10
|
|
108
|
+
|
|
109
|
+
# Offense count: 27
|
|
110
|
+
RSpec/NestedGroups:
|
|
111
|
+
Max: 5
|
|
112
|
+
|
|
113
|
+
# Offense count: 1
|
|
114
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
|
115
|
+
RSpec/VerifiedDoubles:
|
|
79
116
|
Exclude:
|
|
80
|
-
- '
|
|
117
|
+
- 'spec/support/shared_context.rb'
|
|
118
|
+
|
|
119
|
+
# Offense count: 1
|
|
120
|
+
# Configuration parameters: AllowedChars.
|
|
121
|
+
Style/AsciiComments:
|
|
122
|
+
Exclude:
|
|
123
|
+
- '**/*.md'
|
|
124
|
+
- '**/*.markdown'
|
|
125
|
+
- 'lib/debug_logging/configuration.rb'
|
|
81
126
|
|
|
82
|
-
# Offense count:
|
|
127
|
+
# Offense count: 13
|
|
83
128
|
Style/Documentation:
|
|
84
129
|
Exclude:
|
|
85
|
-
- '
|
|
86
|
-
- '
|
|
130
|
+
- '**/*.md'
|
|
131
|
+
- '**/*.markdown'
|
|
87
132
|
- 'lib/debug_logging.rb'
|
|
88
133
|
- 'lib/debug_logging/argument_printer.rb'
|
|
89
134
|
- 'lib/debug_logging/class_logger.rb'
|
|
@@ -96,7 +141,7 @@ Style/Documentation:
|
|
|
96
141
|
- 'lib/debug_logging/log_subscriber.rb'
|
|
97
142
|
- 'lib/simple_debug_logging.rb'
|
|
98
143
|
|
|
99
|
-
# Offense count:
|
|
144
|
+
# Offense count: 2
|
|
100
145
|
# Cop supports --auto-correct.
|
|
101
146
|
# Configuration parameters: EnforcedStyle.
|
|
102
147
|
# SupportedStyles: empty, nil, both
|
|
@@ -105,14 +150,7 @@ Style/EmptyElse:
|
|
|
105
150
|
- 'lib/debug_logging/class_logger.rb'
|
|
106
151
|
- 'lib/debug_logging/class_notifier.rb'
|
|
107
152
|
|
|
108
|
-
# Offense count:
|
|
109
|
-
# Configuration parameters: EnforcedStyle.
|
|
110
|
-
# SupportedStyles: annotated, template, unannotated
|
|
111
|
-
Style/FormatStringToken:
|
|
112
|
-
Exclude:
|
|
113
|
-
- 'lib/debug_logging/argument_printer.rb'
|
|
114
|
-
|
|
115
|
-
# Offense count: 4
|
|
153
|
+
# Offense count: 8
|
|
116
154
|
Style/IdenticalConditionalBranches:
|
|
117
155
|
Exclude:
|
|
118
156
|
- 'lib/debug_logging/class_logger.rb'
|
|
@@ -120,14 +158,10 @@ Style/IdenticalConditionalBranches:
|
|
|
120
158
|
- 'lib/debug_logging/instance_logger_modulizer.rb'
|
|
121
159
|
- 'lib/debug_logging/instance_notifier_modulizer.rb'
|
|
122
160
|
|
|
123
|
-
# Offense count:
|
|
124
|
-
Style/MultilineBlockChain:
|
|
125
|
-
Exclude:
|
|
126
|
-
- 'lib/debug_logging/argument_printer.rb'
|
|
127
|
-
|
|
128
|
-
# Offense count: 95
|
|
161
|
+
# Offense count: 67
|
|
129
162
|
# Cop supports --auto-correct.
|
|
130
163
|
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
131
164
|
# URISchemes: http, https
|
|
165
|
+
# IgnoredPatterns: (?-mix:^\#)
|
|
132
166
|
Layout/LineLength:
|
|
133
|
-
Max:
|
|
167
|
+
Max: 207
|
data/.travis.yml
CHANGED
|
@@ -9,7 +9,7 @@ before_script:
|
|
|
9
9
|
- ./cc-test-reporter before-build
|
|
10
10
|
|
|
11
11
|
script:
|
|
12
|
-
- bundle exec rubocop -DESP
|
|
12
|
+
- bundle exec rubocop -DESP
|
|
13
13
|
- bundle exec rspec
|
|
14
14
|
|
|
15
15
|
after_script:
|
|
@@ -33,4 +33,4 @@ rvm:
|
|
|
33
33
|
- ruby-2.4.10
|
|
34
34
|
- ruby-2.5.8
|
|
35
35
|
- ruby-2.6.6
|
|
36
|
-
- ruby-2.7.
|
|
36
|
+
- ruby-2.7.2
|
data/README.md
CHANGED
|
@@ -86,7 +86,7 @@ Recommend creating `config/initializers/debug_logging.rb`, or adding to `config/
|
|
|
86
86
|
|
|
87
87
|
```ruby
|
|
88
88
|
# Showing the defaults
|
|
89
|
-
DebugLogging.configuration.logger = Logger.new(
|
|
89
|
+
DebugLogging.configuration.logger = Logger.new($stdout) # you probably want to override to be the Rails.logger, and if so you can't set it in the initializer, as it needs to be set after Rails.logger is set.
|
|
90
90
|
DebugLogging.configuration.log_level = :debug # at what level do the messages created by this gem sent at?
|
|
91
91
|
DebugLogging.configuration.multiple_last_hashes = false # pass every hash argument to last_hash_to_s_proc?
|
|
92
92
|
DebugLogging.configuration.last_hash_to_s_proc = nil # e.g. ->(hash) { "keys: #{hash.keys}" }
|
|
@@ -98,7 +98,7 @@ DebugLogging.configuration.active_support_notifications = false
|
|
|
98
98
|
DebugLogging.configuration.colorized_chain_for_method = false # e.g. ->(colorized_string) { colorized_string.red.on_blue.underline }
|
|
99
99
|
DebugLogging.configuration.colorized_chain_for_class = false # e.g. ->(colorized_string) { colorized_string.colorize(:light_blue ).colorize( :background => :red) }
|
|
100
100
|
DebugLogging.configuration.add_invocation_id = true # identify a method call uniquely in a log, pass a proc for colorization, e.g. ->(colorized_string) { colorized_string.light_black }
|
|
101
|
-
DebugLogging.configuration.ellipsis =
|
|
101
|
+
DebugLogging.configuration.ellipsis = ' ✂️ …'.freeze
|
|
102
102
|
DebugLogging.configuration.mark_scope_exit = true # Only has an effect if benchmarking is off, since benchmarking always marks the scope exit
|
|
103
103
|
```
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ If you prefer to use the block style:
|
|
|
106
106
|
|
|
107
107
|
```ruby
|
|
108
108
|
DebugLogging.configure do |config|
|
|
109
|
-
config.logger = Logger.new(
|
|
109
|
+
config.logger = Logger.new($stdout) # probably want to override to be the Rails.logger, and if so you can't set it in the initializer, as it needs to be set after Rails.logger is set.
|
|
110
110
|
config.log_level = :debug # at what level do the messages created by this gem sent at?
|
|
111
111
|
config.multiple_last_hashes = false # pass every hash argument to last_hash_to_s_proc?
|
|
112
112
|
config.last_hash_to_s_proc = nil # e.g. ->(hash) { "keys: #{hash.keys}" }
|
|
@@ -118,7 +118,7 @@ DebugLogging.configure do |config|
|
|
|
118
118
|
config.colorized_chain_for_method = false # e.g. ->(colorized_string) { colorized_string.red.on_blue.underline }
|
|
119
119
|
config.colorized_chain_for_class = false # e.g. ->(colorized_string) { colorized_string.colorize(:light_blue ).colorize( :background => :red) }
|
|
120
120
|
config.add_invocation_id = true # identify a method call uniquely in a log, pass a proc for colorization, e.g. ->(colorized_string) { colorized_string.light_black }
|
|
121
|
-
config.ellipsis =
|
|
121
|
+
config.ellipsis = ' ✂️ …'.freeze
|
|
122
122
|
config.mark_scope_exit = true # Only has an effect if benchmarking is off, since benchmarking always marks the scope exit
|
|
123
123
|
end
|
|
124
124
|
```
|
|
@@ -160,10 +160,20 @@ class Car
|
|
|
160
160
|
# == BEGIN CLASS METHODS ==
|
|
161
161
|
# For class methods:
|
|
162
162
|
# Option 1: Use *logged* as a method decorator
|
|
163
|
-
logged def self.make
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
def self.
|
|
163
|
+
logged def self.make
|
|
164
|
+
new
|
|
165
|
+
end
|
|
166
|
+
def self.design(*_args)
|
|
167
|
+
new
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def self.safety(*_args)
|
|
171
|
+
new
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def self.dealer_options(*_args)
|
|
175
|
+
new
|
|
176
|
+
end
|
|
167
177
|
|
|
168
178
|
# Option 2: Use *logged* as a macro
|
|
169
179
|
logged :design, :safety
|
|
@@ -174,29 +184,40 @@ class Car
|
|
|
174
184
|
something: 'here', # <= will be logged, and available to last_hash_to_s_proc
|
|
175
185
|
multiple_last_hashes: true # <= Overrides config
|
|
176
186
|
}
|
|
177
|
-
def self.will_not_be_logged
|
|
187
|
+
def self.will_not_be_logged
|
|
188
|
+
false
|
|
189
|
+
end
|
|
178
190
|
# == END CLASS METHODS ==
|
|
179
191
|
|
|
180
192
|
# == BEGIN INSTANCE METHODS ==
|
|
181
193
|
# For instance methods:
|
|
182
194
|
# Option 1: specify the exact method(s) to add logging to
|
|
183
|
-
include DebugLogging::InstanceLogger.new(i_methods: [
|
|
195
|
+
include DebugLogging::InstanceLogger.new(i_methods: %i[drive stop])
|
|
196
|
+
|
|
197
|
+
def drive(speed)
|
|
198
|
+
speed
|
|
199
|
+
end
|
|
184
200
|
|
|
185
|
-
def
|
|
186
|
-
|
|
201
|
+
def stop(**_opts)
|
|
202
|
+
0
|
|
203
|
+
end
|
|
187
204
|
|
|
188
205
|
# For instance methods:
|
|
189
206
|
# Option 2: add logging to all instance methods defined above (but *not* defined below)
|
|
190
|
-
include DebugLogging::InstanceLogger.new(i_methods:
|
|
207
|
+
include DebugLogging::InstanceLogger.new(i_methods: instance_methods(false))
|
|
191
208
|
|
|
192
|
-
def faster(**
|
|
209
|
+
def faster(**_opts)
|
|
210
|
+
0
|
|
211
|
+
end
|
|
193
212
|
|
|
194
213
|
# Override configuration options for any instance method(s), by passing a hash as the last argument
|
|
195
214
|
# In the last hash any non-Configuration keys will be data that gets logged,
|
|
196
215
|
# and also made available to last_hash_to_s_proc
|
|
197
216
|
include DebugLogging::InstanceLogger.new(i_methods: [:faster], config: { add_invocation_id: false })
|
|
198
217
|
|
|
199
|
-
def will_not_be_logged
|
|
218
|
+
def will_not_be_logged
|
|
219
|
+
false
|
|
220
|
+
end
|
|
200
221
|
# == END INSTANCE METHODS ==
|
|
201
222
|
end
|
|
202
223
|
```
|
|
@@ -242,10 +263,20 @@ class Car
|
|
|
242
263
|
# == BEGIN CLASS METHODS ==
|
|
243
264
|
# For class methods:
|
|
244
265
|
# Option 1: Use *notifies* as a method decorator
|
|
245
|
-
notifies def self.make
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
def self.
|
|
266
|
+
notifies def self.make
|
|
267
|
+
new
|
|
268
|
+
end
|
|
269
|
+
def self.design(*_args)
|
|
270
|
+
new
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
def self.safety(*_args)
|
|
274
|
+
new
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
def self.dealer_options(*_args)
|
|
278
|
+
new
|
|
279
|
+
end
|
|
249
280
|
|
|
250
281
|
# Option 2: Use *logged* as a macro
|
|
251
282
|
notifies :design, :safety
|
|
@@ -256,25 +287,36 @@ class Car
|
|
|
256
287
|
something: 'here', # <= will be added to the event payload, and be available to last_hash_to_s_proc
|
|
257
288
|
add_invocation_id: false # <= Overrides config
|
|
258
289
|
}
|
|
259
|
-
def self.will_not_be_notified
|
|
290
|
+
def self.will_not_be_notified
|
|
291
|
+
false
|
|
292
|
+
end
|
|
260
293
|
# == END CLASS METHODS ==
|
|
261
294
|
|
|
262
295
|
# == BEGIN INSTANCE METHODS ==
|
|
263
|
-
def drive(speed)
|
|
264
|
-
|
|
296
|
+
def drive(speed)
|
|
297
|
+
speed
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def stop(**_opts)
|
|
301
|
+
0
|
|
302
|
+
end
|
|
265
303
|
|
|
266
304
|
# For instance methods:
|
|
267
305
|
# Option 2: add instrumentation to all instance methods defined above (but *not* defined below)
|
|
268
|
-
include DebugLogging::InstanceNotifier.new(i_methods:
|
|
306
|
+
include DebugLogging::InstanceNotifier.new(i_methods: instance_methods(false))
|
|
269
307
|
|
|
270
|
-
def faster(**
|
|
308
|
+
def faster(**_opts)
|
|
309
|
+
0
|
|
310
|
+
end
|
|
271
311
|
|
|
272
312
|
# Override options for any instance method(s), by passing a hash as the last argument
|
|
273
313
|
# In the last hash any non-Configuration keys will be data that gets added to the event payload,
|
|
274
314
|
# and also made available to last_hash_to_s_proc
|
|
275
315
|
include DebugLogging::InstanceNotifier.new(i_methods: [:faster], config: { add_invocation_id: false })
|
|
276
316
|
|
|
277
|
-
def will_not_be_notified
|
|
317
|
+
def will_not_be_notified
|
|
318
|
+
false
|
|
319
|
+
end
|
|
278
320
|
# == END INSTANCE METHODS ==
|
|
279
321
|
end
|
|
280
322
|
```
|
data/debug_logging.gemspec
CHANGED
|
@@ -33,7 +33,10 @@ Automatically log selected methods and their arguments as they are called at run
|
|
|
33
33
|
spec.add_development_dependency 'rake', '>= 13'
|
|
34
34
|
spec.add_development_dependency 'rspec', '>= 3'
|
|
35
35
|
spec.add_development_dependency 'rspec-pending_for', '>= 0'
|
|
36
|
-
spec.add_development_dependency 'rubocop', '
|
|
37
|
-
spec.add_development_dependency 'rubocop-
|
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 1.0'
|
|
37
|
+
spec.add_development_dependency 'rubocop-md'
|
|
38
|
+
spec.add_development_dependency 'rubocop-performance'
|
|
39
|
+
spec.add_development_dependency 'rubocop-rake'
|
|
40
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
|
38
41
|
spec.add_development_dependency 'silent_stream', '>= 1'
|
|
39
42
|
end
|
|
@@ -38,7 +38,7 @@ module DebugLogging
|
|
|
38
38
|
"#{klass_string}#{separator}#{method_string}"
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
def debug_signature_to_s(args: nil, config_proxy: nil) # rubocop:disable Metrics/CyclomaticComplexity
|
|
41
|
+
def debug_signature_to_s(args: nil, config_proxy: nil) # rubocop:disable Metrics/CyclomaticComplexity
|
|
42
42
|
return '' unless args && config_proxy
|
|
43
43
|
|
|
44
44
|
printed_args = ''
|
|
@@ -51,7 +51,7 @@ module DebugLogging
|
|
|
51
51
|
# )
|
|
52
52
|
#
|
|
53
53
|
CONFIG_KEYS.each do |key|
|
|
54
|
-
|
|
54
|
+
alias_method :"debug_#{key}", :"#{key}"
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
class << self
|
|
@@ -76,7 +76,7 @@ module DebugLogging
|
|
|
76
76
|
return unless enabled
|
|
77
77
|
return unless logger
|
|
78
78
|
|
|
79
|
-
if
|
|
79
|
+
if block
|
|
80
80
|
logger.send(log_level, &block)
|
|
81
81
|
else
|
|
82
82
|
logger.send(log_level, message)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: debug_logging
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Boling
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-12-
|
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colorize
|
|
@@ -116,32 +116,74 @@ dependencies:
|
|
|
116
116
|
version: '0'
|
|
117
117
|
- !ruby/object:Gem::Dependency
|
|
118
118
|
name: rubocop
|
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '1.0'
|
|
124
|
+
type: :development
|
|
125
|
+
prerelease: false
|
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "~>"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '1.0'
|
|
131
|
+
- !ruby/object:Gem::Dependency
|
|
132
|
+
name: rubocop-md
|
|
119
133
|
requirement: !ruby/object:Gem::Requirement
|
|
120
134
|
requirements:
|
|
121
135
|
- - ">="
|
|
122
136
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '0
|
|
137
|
+
version: '0'
|
|
124
138
|
type: :development
|
|
125
139
|
prerelease: false
|
|
126
140
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
141
|
requirements:
|
|
128
142
|
- - ">="
|
|
129
143
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: '0
|
|
144
|
+
version: '0'
|
|
131
145
|
- !ruby/object:Gem::Dependency
|
|
132
|
-
name: rubocop-
|
|
146
|
+
name: rubocop-performance
|
|
133
147
|
requirement: !ruby/object:Gem::Requirement
|
|
134
148
|
requirements:
|
|
135
149
|
- - ">="
|
|
136
150
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: '
|
|
151
|
+
version: '0'
|
|
138
152
|
type: :development
|
|
139
153
|
prerelease: false
|
|
140
154
|
version_requirements: !ruby/object:Gem::Requirement
|
|
141
155
|
requirements:
|
|
142
156
|
- - ">="
|
|
143
157
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '
|
|
158
|
+
version: '0'
|
|
159
|
+
- !ruby/object:Gem::Dependency
|
|
160
|
+
name: rubocop-rake
|
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - ">="
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '0'
|
|
166
|
+
type: :development
|
|
167
|
+
prerelease: false
|
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
169
|
+
requirements:
|
|
170
|
+
- - ">="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '0'
|
|
173
|
+
- !ruby/object:Gem::Dependency
|
|
174
|
+
name: rubocop-rspec
|
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
|
176
|
+
requirements:
|
|
177
|
+
- - "~>"
|
|
178
|
+
- !ruby/object:Gem::Version
|
|
179
|
+
version: '2.0'
|
|
180
|
+
type: :development
|
|
181
|
+
prerelease: false
|
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
183
|
+
requirements:
|
|
184
|
+
- - "~>"
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: '2.0'
|
|
145
187
|
- !ruby/object:Gem::Dependency
|
|
146
188
|
name: silent_stream
|
|
147
189
|
requirement: !ruby/object:Gem::Requirement
|