k_log 0.0.17 → 0.0.27

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.
@@ -1,381 +1,408 @@
1
- # frozen_string_literal: true
2
-
3
- # Format Logger Util provides static helper methods that delegate responsibility
4
- # to the underlying Format Logger, you can use the Util instead Rails.logger so
5
- # that you have access to IDE intellisense around available methods and so you
6
- # can use the same logger calls from controllers/models which normally have
7
- # access to to a logger variable and services which do not have access to a
8
- # logger variable
9
- #
10
- # I usually alias the call to LogUtil by doing L = LogUtil
11
-
12
- # require_relative 'format_logger'
13
- # require_relative 'format_logger_helper'
14
-
15
- module KLog
16
- # Simple console log helpers
17
- class LogUtil
18
- def initialize(logger)
19
- @logger = logger
20
- end
21
-
22
- # include ActiveSupport::LoggerThreadSafeLevel
23
- # include LoggerSilence
24
-
25
- #----------------------------------------------------------------------------------------------------
26
- # Standard Accessors that are on the standard rails Logger
27
- #----------------------------------------------------------------------------------------------------
28
- def debug(value)
29
- @logger.debug(value)
30
- end
31
-
32
- def info(value)
33
- @logger.info(value)
34
- end
35
-
36
- def warn(value)
37
- @logger.warn(value)
38
- end
39
-
40
- def error(value)
41
- @logger.error(value)
42
- end
43
-
44
- def fatal(value)
45
- @logger.fatal(value)
46
- end
47
-
48
- #----------------------------------------------------------------------------------------------------
49
- # Helper Log output Methods
50
- #----------------------------------------------------------------------------------------------------
51
-
52
- # Write a Key/Value Pair
53
- # Need to change this to named_param
54
- def kv(key, value, key_width = 30)
55
- message = LogHelper.kv(key, value, key_width)
56
- @logger.info(message)
57
- end
58
-
59
- # Write a progress point, progress will update on it's own
60
- def progress(pos = nil, section = nil)
61
- message = LogHelper.progress(pos, section)
62
- # @logger.debug(message)
63
- @logger.info(message)
64
-
65
- LogHelper.progress_position
66
- end
67
-
68
- # prints out a line to the log
69
- def line(size = 70, character: '=')
70
- message = LogHelper.line(size, character)
71
-
72
- @logger.info(message)
73
- end
74
-
75
- def heading(heading, size = 70)
76
- lines = LogHelper.heading(heading, size)
77
- info_multi_lines(lines)
78
- end
79
-
80
- def subheading(heading, size = 70)
81
- lines = LogHelper.subheading(heading, size)
82
-
83
- info_multi_lines(lines)
84
- end
85
-
86
- # A section heading
87
- #
88
- # example:
89
- # [ I am a heading ]----------------------------------------------------
90
- def section_heading(heading, size = 70)
91
- heading = LogHelper.section_heading(heading, size)
92
-
93
- info(heading)
94
- end
95
-
96
- def block(messages, include_line: true, title: nil)
97
- lines = LogHelper.block(messages, include_line: include_line, title: title)
98
-
99
- info_multi_lines(lines)
100
- end
101
-
102
- # # :sql_array should be an array with SQL and values or with SQL and Hash
103
- # # example:
104
- # # KLog.logger.sql(["name = :name and group_id = :value OR parent_id = :value", name: "foo'bar", value: 4])
105
- # # KLog.logger.sql([sql_exact_match_skills_in_use, {names: self.segments_container.segment_values}])
106
- # def sql(sql_array)
107
- # value = ActiveRecord::Base.send(:sanitize_sql_array, sql_array)
108
-
109
- # info(value)
110
- # end
111
-
112
- def yaml(data, is_line: true)
113
- require 'yaml'
114
- line if is_line
115
-
116
- @logger.info(data.to_yaml) if data.is_a?(Hash)
117
-
118
- @logger.info(data.marshal_dump.to_yaml) if data.is_a?(OpenStruct)
119
-
120
- if data.is_a? Array
121
- data.each do |d|
122
- @logger.info(d.to_yaml)
123
- end
124
- end
125
-
126
- line if is_line
127
- end
128
-
129
- def json(data)
130
- @logger.info(JSON.pretty_generate(data))
131
- end
132
- alias j json
133
-
134
- # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/AbcSize
135
- def open_struct(data, indent = '', **opts)
136
- data.each_pair do |key, value|
137
- case value
138
- when OpenStruct
139
- if value['rows'].is_a?(Array)
140
- # KLog.logger.subheading(key)
141
- opts[:subheading] = key
142
- open_struct(value, indent, **opts)
143
- opts.delete(:subheading)
144
- else
145
- KLog.logger.kv "#{indent}#{key}", ''
146
- indent = "#{indent} "
147
- open_struct(value, indent, **opts)
148
- indent = indent.chomp(' ')
149
- end
150
- when Array
151
- next unless opts[:skip_array].nil?
152
-
153
- puts LogHelper.section_heading(opts[:subheading], 88) unless opts[:subheading].nil?
154
-
155
- if value.length.positive?
156
- if value.first.is_a?(String)
157
- KLog.logger.kv "#{indent}#{key}", value.join(', ')
158
- else
159
- tp value, value.first.to_h.keys
160
- end
161
- end
162
- else
163
- KLog.logger.kv "#{indent}#{key}", value
164
- end
165
- end
166
- nil
167
- end
168
- # rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/AbcSize
169
- alias ostruct open_struct
170
- alias o open_struct
171
-
172
- def exception(exception)
173
- line
174
-
175
- @logger.info(exception.message)
176
- @logger.info(exception.backtrace.join("\n"))
177
-
178
- line
179
- end
180
-
181
- #----------------------------------------------------------------------------------------------------
182
- # Pretty Loggers
183
- #----------------------------------------------------------------------------------------------------
184
-
185
- # NOTE: using pretty_inspect is an existing namespace conflict
186
- # rubocop:disable Metrics/AbcSize
187
- def pretty_class(instance)
188
- c = instance.class
189
-
190
- line
191
-
192
- kv('Full Class', c.name)
193
- kv('Module', c.name.deconstantize)
194
- kv('Class', c.name.demodulize)
195
-
196
- source_location = c.instance_methods(false).map do |m|
197
- c.instance_method(m).source_location.first
198
- end.uniq
199
-
200
- begin
201
- kv('Source Location', source_location)
202
- rescue StandardError => e
203
- warn e
204
- end
205
-
206
- line
207
- end
208
- # rubocop:enable Metrics/AbcSize
209
-
210
- def kv_hash(hash)
211
- hash.each do |key, value|
212
- kv(key, value)
213
- end
214
- end
215
-
216
- # NOTE: using pretty_inspect is an existing namespace conflict
217
- def pretty_params(params)
218
- line
219
-
220
- params.each do |k, v|
221
- if params[k].is_a?(Hash)
222
-
223
- params[k].each do |child_k, child_v|
224
- kv("#{k}[#{child_k}]", child_v)
225
- end
226
-
227
- else
228
- kv(k, v)
229
- end
230
- end
231
-
232
- line
233
- end
234
-
235
- def help_all_symbols
236
- # Produces a lot of data, need some sort of filter I think before this is useful
237
- Symbol.all_symbols.each do |s|
238
- info s
239
- # debug s
240
- end
241
- end
242
-
243
- def visual_compare_hashes(hash1, hash2)
244
- content1 = JSON.pretty_generate(hash1)
245
- content2 = JSON.pretty_generate(hash2)
246
-
247
- file1 = Tempfile.new('hash1')
248
- file1.write(content1)
249
- file1.close
250
-
251
- file2 = Tempfile.new('hash2')
252
- file2.write(content2)
253
- file2.close
254
-
255
- system "code --diff #{file1.path} #{file2.path}"
256
-
257
- # Provide enough time for vscode to open and display the files before deleting them
258
- sleep 1
259
-
260
- file1.unlink
261
- file2.unlink
262
- end
263
-
264
- #----------------------------------------------------------------------------------------------------
265
- # Internal Methods
266
- #----------------------------------------------------------------------------------------------------
267
-
268
- # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
269
- def self.examples
270
- examples_simple
271
- # examples_complex
272
- end
273
-
274
- def self.examples_simple
275
- KLog.logger.debug 'some debug message'
276
- KLog.logger.info 'some info message'
277
- KLog.logger.warn 'some warning message'
278
- KLog.logger.error 'some error message'
279
- KLog.logger.fatal 'some fatal message'
280
-
281
- KLog.logger.kv('First Name', 'David')
282
- KLog.logger.kv('Last Name', 'Cruwys')
283
- KLog.logger.kv('Age', 45)
284
- KLog.logger.kv('Sex', 'male')
285
-
286
- KLog.logger.heading('Heading')
287
- KLog.logger.subheading('Sub Heading')
288
- KLog.logger.section_heading('Section Heading')
289
- end
290
-
291
- def self.examples_complex
292
- KLog.logger.block ['Line 1', 12, 'Line 3', true, 'Line 5']
293
-
294
- KLog.logger.progress(0, 'Section 1')
295
- KLog.logger.progress
296
- KLog.logger.progress
297
- save_progress = KLog.logger.progress
298
-
299
- KLog.logger.progress(10, 'Section 2')
300
- KLog.logger.progress
301
- KLog.logger.progress
302
- KLog.logger.progress
303
-
304
- KLog.logger.progress(save_progress, 'Section 1')
305
- KLog.logger.progress
306
- KLog.logger.progress
307
- KLog.logger.progress
308
-
309
- KLog.logger.line
310
- KLog.logger.line(20)
311
- KLog.logger.line(20, character: '-')
312
-
313
- yaml1 = {}
314
- yaml1['title'] = 'Software Architect'
315
- yaml1['age'] = 45
316
- yaml1['name'] = 'David'
317
-
318
- yaml3 = {}
319
- yaml3['title'] = 'Developer'
320
- yaml3['age'] = 20
321
- yaml3['name'] = 'Jin'
322
-
323
- KLog.logger.yaml(yaml1)
324
-
325
- yaml2 = OpenStruct.new
326
- yaml2.title = 'Software Architect'
327
- yaml2.age = 45
328
- yaml2.name = 'David'
329
-
330
- KLog.logger.yaml(yaml2)
331
-
332
- mixed_yaml_array = [yaml1, yaml2]
333
-
334
- # This fails because we don't correctly pre-process the array
335
- KLog.logger.yaml(mixed_yaml_array)
336
-
337
- hash_yaml_array = [yaml1, yaml3]
338
-
339
- KLog.logger.yaml(hash_yaml_array)
340
-
341
- begin
342
- raise 'Here is an error'
343
- rescue StandardError => e
344
- KLog.logger.exception(e)
345
- end
346
- end
347
- # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
348
-
349
- private
350
-
351
- def debug_multi_lines(lines)
352
- lines.each do |line|
353
- debug(line)
354
- end
355
- end
356
-
357
- def info_multi_lines(lines)
358
- lines.each do |line|
359
- info(line)
360
- end
361
- end
362
-
363
- def warn_multi_lines(lines)
364
- lines.each do |line|
365
- warn(line)
366
- end
367
- end
368
-
369
- def error_multi_lines(lines)
370
- lines.each do |line|
371
- error(line)
372
- end
373
- end
374
-
375
- def fatal_multi_lines(lines)
376
- lines.each do |line|
377
- fatal(line)
378
- end
379
- end
380
- end
381
- end
1
+ # frozen_string_literal: true
2
+
3
+ # Format Logger Util provides static helper methods that delegate responsibility
4
+ # to the underlying Format Logger, you can use the Util instead Rails.logger so
5
+ # that you have access to IDE intellisense around available methods and so you
6
+ # can use the same logger calls from controllers/models which normally have
7
+ # access to to a logger variable and services which do not have access to a
8
+ # logger variable
9
+ #
10
+ # I usually alias the call to LogUtil by doing L = LogUtil
11
+
12
+ # require_relative 'format_logger'
13
+ # require_relative 'format_logger_helper'
14
+
15
+ module KLog
16
+ # Simple console log helpers
17
+ class LogUtil
18
+ def initialize(logger)
19
+ @logger = logger
20
+ end
21
+
22
+ # include ActiveSupport::LoggerThreadSafeLevel
23
+ # include LoggerSilence
24
+
25
+ #----------------------------------------------------------------------------------------------------
26
+ # Standard Accessors that are on the standard rails Logger
27
+ #----------------------------------------------------------------------------------------------------
28
+ def debug(value)
29
+ @logger.debug(value)
30
+ end
31
+
32
+ def info(value)
33
+ @logger.info(value)
34
+ end
35
+
36
+ def warn(value)
37
+ @logger.warn(value)
38
+ end
39
+
40
+ def error(value)
41
+ @logger.error(value)
42
+ end
43
+
44
+ def fatal(value)
45
+ @logger.fatal(value)
46
+ end
47
+
48
+ #----------------------------------------------------------------------------------------------------
49
+ # Helper Log output Methods
50
+ #----------------------------------------------------------------------------------------------------
51
+
52
+ # Write a Key/Value Pair
53
+ # Need to change this to named_param
54
+ def kv(key, value, key_width = 30)
55
+ message = LogHelper.kv(key, value, key_width)
56
+ @logger.info(message)
57
+ end
58
+
59
+ # Write a progress point, progress will update on it's own
60
+ def progress(pos = nil, section = nil)
61
+ message = LogHelper.progress(pos, section)
62
+ # @logger.debug(message)
63
+ @logger.info(message)
64
+
65
+ LogHelper.progress_position
66
+ end
67
+
68
+ # prints out a line to the log
69
+ def line(size = 70, character: '=')
70
+ message = LogHelper.line(size, character)
71
+
72
+ @logger.info(message)
73
+ end
74
+
75
+ def dynamic_heading(heading, size: 70, type: :heading)
76
+ KLog.logger.heading(heading, size) if type == :heading
77
+ KLog.logger.subheading(heading, size) if type == :subheading
78
+ KLog.logger.section_heading(heading, size) if %i[section_heading section].include?(type)
79
+ end
80
+
81
+ def heading(heading, size = 70)
82
+ lines = LogHelper.heading(heading, size)
83
+ info_multi_lines(lines)
84
+ end
85
+
86
+ def subheading(heading, size = 70)
87
+ lines = LogHelper.subheading(heading, size)
88
+
89
+ info_multi_lines(lines)
90
+ end
91
+
92
+ # A section heading
93
+ #
94
+ # example:
95
+ # [ I am a heading ]----------------------------------------------------
96
+ def section_heading(heading, size = 70)
97
+ heading = LogHelper.section_heading(heading, size)
98
+
99
+ info(heading)
100
+ end
101
+
102
+ def block(messages, include_line: true, title: nil)
103
+ lines = LogHelper.block(messages, include_line: include_line, title: title)
104
+
105
+ info_multi_lines(lines)
106
+ end
107
+
108
+ # # :sql_array should be an array with SQL and values or with SQL and Hash
109
+ # # example:
110
+ # # KLog.logger.sql(["name = :name and group_id = :value OR parent_id = :value", name: "foo'bar", value: 4])
111
+ # # KLog.logger.sql([sql_exact_match_skills_in_use, {names: self.segments_container.segment_values}])
112
+ # def sql(sql_array)
113
+ # value = ActiveRecord::Base.send(:sanitize_sql_array, sql_array)
114
+
115
+ # info(value)
116
+ # end
117
+
118
+ def yaml(data, is_line: true)
119
+ require 'yaml'
120
+ line if is_line
121
+
122
+ @logger.info(data.to_yaml) if data.is_a?(Hash)
123
+
124
+ @logger.info(data.marshal_dump.to_yaml) if data.is_a?(OpenStruct)
125
+
126
+ if data.is_a? Array
127
+ data.each do |d|
128
+ @logger.info(d.to_yaml)
129
+ end
130
+ end
131
+
132
+ line if is_line
133
+ end
134
+
135
+ def json(data)
136
+ @logger.info(JSON.pretty_generate(data))
137
+ end
138
+ alias j json
139
+
140
+ # Log a structure
141
+ #
142
+ # Can handle Hash, Array, OpenStruct, Struct, DryStruct, Hash convertible custom classes
143
+ #
144
+ # @param [Hash] **opts Options
145
+ # @option opts [String] :indent Indent with string, defaults to ''
146
+ # @option opts [String] :depth is a computered
147
+ # @option opts [String] :heading Log title using logger.dynamic_heading
148
+ # @option opts [String] :heading_type :heading, :subheading, :section_heading
149
+ # @option opts [Boolean] :skip_array Arrays items can be skipped
150
+ def structure(data, **opts)
151
+ structure = LogStructure.new(**opts)
152
+ structure.log(data)
153
+ end
154
+
155
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/AbcSize
156
+ # DEPRECATE
157
+ def open_struct(data, indent = '', **opts)
158
+ KLog.logger.heading(opts[:heading], 88) unless opts[:heading].nil?
159
+ KLog.logger.subheading(opts[:subheading], 88) unless opts[:subheading].nil?
160
+ KLog.logger.section_heading(opts[:section_heading], 88) unless opts[:section_heading].nil?
161
+
162
+ data.each_pair do |key, value|
163
+ case value
164
+ when OpenStruct
165
+ if value['rows'].is_a?(Array)
166
+ # KLog.logger.subheading(key)
167
+ opts[:subheading] = key
168
+ open_struct(value, indent, **opts)
169
+ opts.delete(:subheading)
170
+ else
171
+ KLog.logger.kv "#{indent}#{key}", ''
172
+ indent = "#{indent} "
173
+ open_struct(value, indent, **opts)
174
+ indent = indent.chomp(' ')
175
+ end
176
+ when Array
177
+ next unless opts[:skip_array].nil?
178
+
179
+ puts LogHelper.section_heading(opts[:subheading], 88) unless opts[:subheading].nil?
180
+
181
+ if value.length.positive?
182
+ if value.first.is_a?(String) || value.first.is_a?(Symbol)
183
+ KLog.logger.kv "#{indent}#{key}", value.map(&:to_s).join(', ')
184
+ else
185
+ tp value, value.first.to_h.keys
186
+ end
187
+ end
188
+ else
189
+ KLog.logger.kv "#{indent}#{key}", value
190
+ end
191
+ end
192
+ nil
193
+ end
194
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/AbcSize
195
+ alias ostruct open_struct
196
+ alias o open_struct
197
+
198
+ def exception(exception)
199
+ line
200
+
201
+ @logger.info(KLog::LogHelper.bg_red(exception.message))
202
+
203
+ @logger.info(KLog::LogHelper.yellow(exception.backtrace.map { |row| row.start_with?(Dir.pwd) ? KLog::LogHelper.yellow(row) : KLog::LogHelper.red(row) }.join("\n")))
204
+
205
+ line
206
+ end
207
+
208
+ #----------------------------------------------------------------------------------------------------
209
+ # Pretty Loggers
210
+ #----------------------------------------------------------------------------------------------------
211
+
212
+ # NOTE: using pretty_inspect is an existing namespace conflict
213
+ # rubocop:disable Metrics/AbcSize
214
+ def pretty_class(instance)
215
+ c = instance.class
216
+
217
+ line
218
+
219
+ kv('Full Class', c.name)
220
+ kv('Module', c.name.deconstantize)
221
+ kv('Class', c.name.demodulize)
222
+
223
+ source_location = c.instance_methods(false).map do |m|
224
+ c.instance_method(m).source_location.first
225
+ end.uniq
226
+
227
+ begin
228
+ kv('Source Location', source_location)
229
+ rescue StandardError => e
230
+ warn e
231
+ end
232
+
233
+ line
234
+ end
235
+ # rubocop:enable Metrics/AbcSize
236
+
237
+ def kv_hash(hash)
238
+ hash.each do |key, value|
239
+ kv(key, value)
240
+ end
241
+ end
242
+
243
+ # NOTE: using pretty_inspect is an existing namespace conflict
244
+ def pretty_params(params)
245
+ line
246
+
247
+ params.each do |k, v|
248
+ if params[k].is_a?(Hash)
249
+
250
+ params[k].each do |child_k, child_v|
251
+ kv("#{k}[#{child_k}]", child_v)
252
+ end
253
+
254
+ else
255
+ kv(k, v)
256
+ end
257
+ end
258
+
259
+ line
260
+ end
261
+
262
+ def help_all_symbols
263
+ # Produces a lot of data, need some sort of filter I think before this is useful
264
+ Symbol.all_symbols.each do |s|
265
+ info s
266
+ # debug s
267
+ end
268
+ end
269
+
270
+ def visual_compare_hashes(hash1, hash2)
271
+ content1 = JSON.pretty_generate(hash1)
272
+ content2 = JSON.pretty_generate(hash2)
273
+
274
+ file1 = Tempfile.new('hash1')
275
+ file1.write(content1)
276
+ file1.close
277
+
278
+ file2 = Tempfile.new('hash2')
279
+ file2.write(content2)
280
+ file2.close
281
+
282
+ system "code --diff #{file1.path} #{file2.path}"
283
+
284
+ # Provide enough time for vscode to open and display the files before deleting them
285
+ sleep 1
286
+
287
+ file1.unlink
288
+ file2.unlink
289
+ end
290
+
291
+ #----------------------------------------------------------------------------------------------------
292
+ # Internal Methods
293
+ #----------------------------------------------------------------------------------------------------
294
+
295
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
296
+ def self.examples
297
+ examples_simple
298
+ # examples_complex
299
+ end
300
+
301
+ def self.examples_simple
302
+ KLog.logger.debug 'some debug message'
303
+ KLog.logger.info 'some info message'
304
+ KLog.logger.warn 'some warning message'
305
+ KLog.logger.error 'some error message'
306
+ KLog.logger.fatal 'some fatal message'
307
+
308
+ KLog.logger.kv('First Name', 'David')
309
+ KLog.logger.kv('Last Name', 'Cruwys')
310
+ KLog.logger.kv('Age', 45)
311
+ KLog.logger.kv('Sex', 'male')
312
+
313
+ KLog.logger.heading('Heading')
314
+ KLog.logger.subheading('Sub Heading')
315
+ KLog.logger.section_heading('Section Heading')
316
+ end
317
+
318
+ def self.examples_complex
319
+ KLog.logger.block ['Line 1', 12, 'Line 3', true, 'Line 5']
320
+
321
+ KLog.logger.progress(0, 'Section 1')
322
+ KLog.logger.progress
323
+ KLog.logger.progress
324
+ save_progress = KLog.logger.progress
325
+
326
+ KLog.logger.progress(10, 'Section 2')
327
+ KLog.logger.progress
328
+ KLog.logger.progress
329
+ KLog.logger.progress
330
+
331
+ KLog.logger.progress(save_progress, 'Section 1')
332
+ KLog.logger.progress
333
+ KLog.logger.progress
334
+ KLog.logger.progress
335
+
336
+ KLog.logger.line
337
+ KLog.logger.line(20)
338
+ KLog.logger.line(20, character: '-')
339
+
340
+ yaml1 = {}
341
+ yaml1['title'] = 'Software Architect'
342
+ yaml1['age'] = 45
343
+ yaml1['name'] = 'David'
344
+
345
+ yaml3 = {}
346
+ yaml3['title'] = 'Developer'
347
+ yaml3['age'] = 20
348
+ yaml3['name'] = 'Jin'
349
+
350
+ KLog.logger.yaml(yaml1)
351
+
352
+ yaml2 = OpenStruct.new
353
+ yaml2.title = 'Software Architect'
354
+ yaml2.age = 45
355
+ yaml2.name = 'David'
356
+
357
+ KLog.logger.yaml(yaml2)
358
+
359
+ mixed_yaml_array = [yaml1, yaml2]
360
+
361
+ # This fails because we don't correctly pre-process the array
362
+ KLog.logger.yaml(mixed_yaml_array)
363
+
364
+ hash_yaml_array = [yaml1, yaml3]
365
+
366
+ KLog.logger.yaml(hash_yaml_array)
367
+
368
+ begin
369
+ raise 'Here is an error'
370
+ rescue StandardError => e
371
+ KLog.logger.exception(e)
372
+ end
373
+ end
374
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
375
+
376
+ private
377
+
378
+ def debug_multi_lines(lines)
379
+ lines.each do |line|
380
+ debug(line)
381
+ end
382
+ end
383
+
384
+ def info_multi_lines(lines)
385
+ lines.each do |line|
386
+ info(line)
387
+ end
388
+ end
389
+
390
+ def warn_multi_lines(lines)
391
+ lines.each do |line|
392
+ warn(line)
393
+ end
394
+ end
395
+
396
+ def error_multi_lines(lines)
397
+ lines.each do |line|
398
+ error(line)
399
+ end
400
+ end
401
+
402
+ def fatal_multi_lines(lines)
403
+ lines.each do |line|
404
+ fatal(line)
405
+ end
406
+ end
407
+ end
408
+ end