makit 0.0.111 → 0.0.112

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.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -41
  3. data/exe/makit +5 -5
  4. data/lib/makit/apache.rb +28 -28
  5. data/lib/makit/cli/build_commands.rb +500 -500
  6. data/lib/makit/cli/generators/base_generator.rb +74 -74
  7. data/lib/makit/cli/generators/dotnet_generator.rb +50 -50
  8. data/lib/makit/cli/generators/generator_factory.rb +49 -49
  9. data/lib/makit/cli/generators/node_generator.rb +50 -50
  10. data/lib/makit/cli/generators/ruby_generator.rb +77 -77
  11. data/lib/makit/cli/generators/rust_generator.rb +50 -50
  12. data/lib/makit/cli/generators/templates/dotnet_templates.rb +167 -167
  13. data/lib/makit/cli/generators/templates/node_templates.rb +161 -161
  14. data/lib/makit/cli/generators/templates/ruby/gemfile.rb +26 -26
  15. data/lib/makit/cli/generators/templates/ruby/gemspec.rb +40 -40
  16. data/lib/makit/cli/generators/templates/ruby/main_lib.rb +33 -33
  17. data/lib/makit/cli/generators/templates/ruby/rakefile.rb +35 -35
  18. data/lib/makit/cli/generators/templates/ruby/readme.rb +63 -63
  19. data/lib/makit/cli/generators/templates/ruby/test.rb +39 -39
  20. data/lib/makit/cli/generators/templates/ruby/test_helper.rb +29 -29
  21. data/lib/makit/cli/generators/templates/ruby/version.rb +29 -29
  22. data/lib/makit/cli/generators/templates/rust_templates.rb +128 -128
  23. data/lib/makit/cli/main.rb +62 -62
  24. data/lib/makit/cli/project_commands.rb +868 -868
  25. data/lib/makit/cli/repository_commands.rb +661 -661
  26. data/lib/makit/cli/utility_commands.rb +521 -521
  27. data/lib/makit/commands/factory.rb +359 -359
  28. data/lib/makit/commands/middleware/base.rb +73 -73
  29. data/lib/makit/commands/middleware/cache.rb +248 -248
  30. data/lib/makit/commands/middleware/command_logger.rb +320 -323
  31. data/lib/makit/commands/middleware/unified_logger.rb +243 -243
  32. data/lib/makit/commands/middleware/validator.rb +269 -269
  33. data/lib/makit/commands/request.rb +254 -254
  34. data/lib/makit/commands/result.rb +323 -323
  35. data/lib/makit/commands/runner.rb +337 -317
  36. data/lib/makit/commands/strategies/base.rb +160 -160
  37. data/lib/makit/commands/strategies/synchronous.rb +134 -134
  38. data/lib/makit/commands.rb +51 -42
  39. data/lib/makit/configuration/gitlab_helper.rb +60 -60
  40. data/lib/makit/configuration/project.rb +127 -127
  41. data/lib/makit/configuration/rakefile_helper.rb +43 -43
  42. data/lib/makit/configuration/step.rb +34 -34
  43. data/lib/makit/configuration.rb +14 -14
  44. data/lib/makit/content/default_gitignore.rb +7 -7
  45. data/lib/makit/content/default_rakefile.rb +13 -13
  46. data/lib/makit/content/gem_rakefile.rb +16 -16
  47. data/lib/makit/context.rb +1 -1
  48. data/lib/makit/data.rb +49 -49
  49. data/lib/makit/directories.rb +141 -141
  50. data/lib/makit/directory.rb +262 -262
  51. data/lib/makit/docs/files.rb +89 -89
  52. data/lib/makit/docs/rake.rb +102 -102
  53. data/lib/makit/dotnet/project.rb +153 -153
  54. data/lib/makit/dotnet/solution.rb +38 -38
  55. data/lib/makit/dotnet/solution_classlib.rb +239 -239
  56. data/lib/makit/dotnet/solution_console.rb +264 -264
  57. data/lib/makit/dotnet/solution_maui.rb +354 -354
  58. data/lib/makit/dotnet/solution_wasm.rb +275 -275
  59. data/lib/makit/dotnet/solution_wpf.rb +304 -304
  60. data/lib/makit/dotnet.rb +102 -102
  61. data/lib/makit/email.rb +90 -90
  62. data/lib/makit/environment.rb +142 -142
  63. data/lib/makit/examples/runner.rb +370 -370
  64. data/lib/makit/exceptions.rb +45 -45
  65. data/lib/makit/fileinfo.rb +24 -24
  66. data/lib/makit/files.rb +43 -43
  67. data/lib/makit/gems.rb +40 -40
  68. data/lib/makit/git/cli.rb +54 -54
  69. data/lib/makit/git/repository.rb +90 -90
  70. data/lib/makit/git.rb +98 -98
  71. data/lib/makit/gitlab_runner.rb +59 -59
  72. data/lib/makit/humanize.rb +137 -137
  73. data/lib/makit/indexer.rb +47 -47
  74. data/lib/makit/logging/configuration.rb +305 -305
  75. data/lib/makit/logging/formatters/base.rb +39 -39
  76. data/lib/makit/logging/formatters/console_formatter.rb +140 -127
  77. data/lib/makit/logging/formatters/json_formatter.rb +65 -65
  78. data/lib/makit/logging/formatters/plain_text_formatter.rb +71 -71
  79. data/lib/makit/logging/formatters/text_formatter.rb +64 -64
  80. data/lib/makit/logging/log_request.rb +115 -115
  81. data/lib/makit/logging/logger.rb +163 -159
  82. data/lib/makit/logging/sinks/console.rb +72 -72
  83. data/lib/makit/logging/sinks/file_sink.rb +92 -92
  84. data/lib/makit/logging/sinks/unified_file_sink.rb +303 -303
  85. data/lib/makit/logging.rb +530 -521
  86. data/lib/makit/markdown.rb +75 -75
  87. data/lib/makit/mp/basic_object_mp.rb +17 -17
  88. data/lib/makit/mp/command_mp.rb +13 -13
  89. data/lib/makit/mp/command_request.mp.rb +17 -17
  90. data/lib/makit/mp/project_mp.rb +199 -199
  91. data/lib/makit/mp/string_mp.rb +193 -348
  92. data/lib/makit/nuget.rb +74 -74
  93. data/lib/makit/port.rb +32 -32
  94. data/lib/makit/process.rb +163 -163
  95. data/lib/makit/protoc.rb +107 -107
  96. data/lib/makit/rake/cli.rb +196 -196
  97. data/lib/makit/rake.rb +25 -25
  98. data/lib/makit/ruby/cli.rb +185 -185
  99. data/lib/makit/ruby.rb +25 -25
  100. data/lib/makit/secrets.rb +51 -51
  101. data/lib/makit/serializer.rb +130 -117
  102. data/lib/makit/services/builder.rb +186 -186
  103. data/lib/makit/services/error_handler.rb +226 -226
  104. data/lib/makit/services/repository_manager.rb +229 -229
  105. data/lib/makit/services/validator.rb +112 -112
  106. data/lib/makit/setup/classlib.rb +53 -53
  107. data/lib/makit/setup/gem.rb +30 -17
  108. data/lib/makit/setup/runner.rb +45 -40
  109. data/lib/makit/setup.rb +5 -0
  110. data/lib/makit/show.rb +110 -110
  111. data/lib/makit/storage.rb +126 -126
  112. data/lib/makit/symbols.rb +170 -161
  113. data/lib/makit/task_info.rb +128 -128
  114. data/lib/makit/tasks/at_exit.rb +13 -13
  115. data/lib/makit/tasks/build.rb +19 -18
  116. data/lib/makit/tasks/clean.rb +11 -11
  117. data/lib/makit/tasks/hook_manager.rb +393 -239
  118. data/lib/makit/tasks/init.rb +47 -47
  119. data/lib/makit/tasks/integrate.rb +17 -15
  120. data/lib/makit/tasks/pull_incoming.rb +11 -12
  121. data/lib/makit/tasks/setup.rb +6 -6
  122. data/lib/makit/tasks/sync.rb +12 -11
  123. data/lib/makit/tasks/tag.rb +15 -0
  124. data/lib/makit/tasks/task_monkey_patch.rb +79 -79
  125. data/lib/makit/tasks.rb +10 -0
  126. data/lib/makit/test_cache.rb +239 -239
  127. data/lib/makit/tree.rb +37 -37
  128. data/lib/makit/v1/makit.v1_pb.rb +34 -34
  129. data/lib/makit/v1/makit.v1_services_pb.rb +27 -27
  130. data/lib/makit/version.rb +5 -5
  131. data/lib/makit/version_util.rb +21 -0
  132. data/lib/makit/wix.rb +95 -95
  133. data/lib/makit/yaml.rb +29 -29
  134. data/lib/makit/zip.rb +17 -17
  135. data/lib/makit copy.rb +44 -0
  136. data/lib/makit.rb +40 -8
  137. metadata +50 -7
  138. data/lib/makit/command_runner.rb +0 -463
  139. data/lib/makit/commands/compatibility.rb +0 -365
  140. data/lib/makit/task_hooks.rb +0 -125
data/lib/makit/logging.rb CHANGED
@@ -1,521 +1,530 @@
1
- # frozen_string_literal: true
2
-
3
- require "logger"
4
- require "colorize"
5
- require_relative "symbols"
6
- require_relative "logging/logger"
7
- require_relative "logging/log_request"
8
- require_relative "logging/sinks/base"
9
- require_relative "logging/sinks/console"
10
- require_relative "logging/sinks/file_sink"
11
- require_relative "logging/sinks/structured"
12
- require_relative "logging/sinks/unified_file_sink"
13
- require_relative "logging/configuration"
14
-
15
- # This module provides classes for the Makit gem.
16
- module Makit
17
- # Logging infrastructure for the Makit gem
18
- #
19
- # This module provides a comprehensive logging system with multiple formatters,
20
- # multi-target output capabilities, and configurable log levels. It supports:
21
- #
22
- # - Plain text logging (suitable for files)
23
- # - Colored console output (improved terminal readability)
24
- # - Structured JSON logging (machine-parsable format)
25
- # - Multi-target logging (write to multiple destinations simultaneously)
26
- # - Sink-based output processing (similar to Commands::Runner)
27
- #
28
- # @deprecated The legacy MultiLogger, Formatter classes, and create_logger method
29
- # are deprecated and will be removed in version 0.2.0. Use the new Logger class
30
- # with sinks instead.
31
- #
32
- # @example Basic usage with new architecture (recommended)
33
- # Makit::Logging.info("Application started")
34
- # Makit::Logging.success("Build completed")
35
- # Makit::Logging.error("Something went wrong")
36
- #
37
- # @example Custom logger configuration
38
- # logger = Makit::Logging::Logger.new(
39
- # sinks: [
40
- # Makit::Logging::Sinks::Console.new,
41
- # Makit::Logging::Sinks::FileSink.new(log_file: "custom.log")
42
- # ]
43
- # )
44
- # logger.info("Custom message")
45
- #
46
- # @example Legacy usage (deprecated - will be removed in v0.2.0)
47
- # logger = Makit::Logging::MultiLogger.create_logger
48
- # logger.info("Application started")
49
- # logger.error("Something went wrong")
50
- module Logging
51
- ANSI_COLOR_REGEX = /\e\[[0-9;]*m/
52
-
53
- # Log levels that can be configured
54
- LOG_LEVELS = {
55
- debug: ::Logger::DEBUG,
56
- info: ::Logger::INFO,
57
- warn: ::Logger::WARN,
58
- error: ::Logger::ERROR,
59
- fatal: ::Logger::FATAL,
60
- }.freeze
61
-
62
- # Default log level
63
- DEFAULT_LOG_LEVEL = :info
64
-
65
- # Get the current log level from environment or use default
66
- def self.current_log_level
67
- env_level = ENV["LOG_LEVEL"]&.downcase&.to_sym
68
- return env_level if env_level && LOG_LEVELS.key?(env_level)
69
- DEFAULT_LOG_LEVEL
70
- end
71
-
72
- # Logs the duration of a rake task to a file
73
- #
74
- # This method calculates the elapsed time since the STARTTIME constant was set
75
- # and appends this information to a log file. Used to track performance of rake tasks.
76
- #
77
- # @return [nil]
78
- def self.log_rake_duration
79
- # use the STARTTIME constant to log the duration of the rake task
80
- # to the log/rake.duration.txt file
81
- duration = Time.now - STARTTIME
82
- FileUtils.mkdir_p("log")
83
- File.open("log/rake.duration.txt", "a") do |file|
84
- file.puts "Rake task duration: #{duration} seconds"
85
- end
86
- end
87
-
88
- # Plain text log formatter that strips ANSI color codes
89
- #
90
- # This formatter removes color codes from log messages and provides
91
- # clean, plain text output suitable for file logging or systems
92
- # that don't support color output.
93
- #
94
- # @deprecated This class is deprecated and will be removed in version 0.2.0.
95
- # Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink instead.
96
- class PlainFormatter < ::Logger::Formatter
97
- # Format a log message as plain text
98
- #
99
- # @param severity [String] log level (DEBUG, INFO, WARN, ERROR, FATAL)
100
- # @param time [Time] timestamp of the log message
101
- # @param _progname [String] program name (unused)
102
- # @param msg [String] the log message content
103
- # @return [String] formatted plain text log entry
104
- def call(severity, time, _progname, msg)
105
- warn "Makit::Logging::PlainFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink instead."
106
- stripped_msg = msg.gsub(ANSI_COLOR_REGEX, "") # Remove ANSI color codes
107
- timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
108
- "[#{timestamp}] #{severity}: #{stripped_msg}\n"
109
- end
110
- end
111
-
112
- # Colored log formatter for terminal output
113
- #
114
- # This formatter adds appropriate colors to different log levels
115
- # to improve readability in terminal environments. Colors are:
116
- # DEBUG (light blue), INFO (green), WARN (yellow), ERROR (red), FATAL (bold red)
117
- #
118
- # @deprecated This class is deprecated and will be removed in version 0.2.0.
119
- # Use Makit::Logging::Logger with Makit::Logging::Sinks::Console instead.
120
- class ColorFormatter < ::Logger::Formatter
121
- # Format a log message with colors
122
- #
123
- # @param severity [String] log level (DEBUG, INFO, WARN, ERROR, FATAL)
124
- # @param time [Time] timestamp of the log message
125
- # @param _progname [String] program name (unused)
126
- # @param msg [String] the log message content
127
- # @return [String] formatted colored log entry
128
- def call(severity, time, _progname, msg)
129
- warn "Makit::Logging::ColorFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::Console instead."
130
- timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
131
- colored_severity = colorize_severity(severity)
132
- "[#{timestamp}] #{colored_severity}: #{msg}\n"
133
- end
134
-
135
- private
136
-
137
- def colorize_severity(severity)
138
- case severity
139
- when "DEBUG"
140
- severity.light_blue
141
- when "INFO"
142
- severity.green
143
- when "WARN"
144
- severity.yellow
145
- when "ERROR"
146
- severity.red
147
- when "FATAL"
148
- severity.red.bold
149
- else
150
- severity
151
- end
152
- end
153
- end
154
-
155
- # Structured JSON log formatter
156
- #
157
- # This formatter outputs log messages as JSON objects with structured
158
- # fields including timestamp, level, message, and program name.
159
- # Useful for log aggregation systems and machine parsing.
160
- #
161
- # @deprecated This class is deprecated and will be removed in version 0.2.0.
162
- # Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink (formatter: :json) instead.
163
- class StructuredFormatter < ::Logger::Formatter
164
- # Format a log message as JSON
165
- #
166
- # @param severity [String] log level (DEBUG, INFO, WARN, ERROR, FATAL)
167
- # @param time [Time] timestamp of the log message
168
- # @param progname [String] program name
169
- # @param msg [String] the log message content
170
- # @return [String] JSON formatted log entry with newline
171
- def call(severity, time, progname, msg)
172
- warn "Makit::Logging::StructuredFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink (formatter: :json) instead."
173
- timestamp = time.strftime("%Y-%m-%d %H:%M:%S.%L")
174
- {
175
- timestamp: timestamp,
176
- level: severity,
177
- message: msg,
178
- progname: progname,
179
- }.to_json + "\n"
180
- end
181
- end
182
-
183
- # Multi-target logger that writes to multiple destinations
184
- #
185
- # This logger allows writing log messages to multiple targets simultaneously,
186
- # such as both stdout and a file, or multiple files with different formats.
187
- #
188
- # @deprecated This class is deprecated and will be removed in version 0.2.0.
189
- # Use Makit::Logging::Logger with multiple middleware instead.
190
- #
191
- # @example Create a logger that writes to both console and file
192
- # stdout_logger = Logger.new($stdout)
193
- # file_logger = Logger.new("app.log")
194
- # multi_logger = MultiLogger.new(stdout_logger, file_logger)
195
- # multi_logger.info("This goes to both destinations")
196
- class MultiLogger
197
- # Initialize a new MultiLogger with multiple logging targets
198
- #
199
- # @param targets [Array<Logger>] One or more logger instances to write to
200
- def initialize(*targets)
201
- warn "Makit::Logging::MultiLogger is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with middleware instead."
202
- @targets = targets
203
- end
204
-
205
- # Add a message to all logger targets
206
- #
207
- # @param severity [Integer] The severity level (::Logger::DEBUG, ::Logger::INFO, etc.)
208
- # @param message [String, nil] The message to log (or nil if using block)
209
- # @param progname [String, nil] The program name to include in the log
210
- # @param block [Proc, nil] Optional block that returns the message to log
211
- # @return [nil]
212
- def add(severity, message = nil, progname = nil, &block)
213
- @targets.each do |logger|
214
- logger.add(severity, message, progname, &block)
215
- logger.flush if logger.respond_to?(:flush)
216
- end
217
- end
218
-
219
- # Append a message directly to all logger targets
220
- #
221
- # @param message [String] The message to append to all loggers
222
- # @return [nil]
223
- def <<(message)
224
- @targets.each do |logger|
225
- logger << message
226
- logger.flush if logger.respond_to?(:flush)
227
- end
228
- end
229
-
230
- # Close all logger targets
231
- #
232
- # @return [nil]
233
- def close
234
- @targets.each(&:close)
235
- end
236
-
237
- # Forward any unknown methods to all logger targets
238
- #
239
- # This allows calling standard Logger methods like info, debug, error, etc.
240
- # directly on the MultiLogger instance.
241
- #
242
- # @param method [Symbol] The method name to forward
243
- # @param args [Array] Arguments to pass to the method
244
- # @return [nil]
245
- def method_missing(method, ...)
246
- @targets.each { |logger| logger.send(method, ...) }
247
- end
248
-
249
- # Check if all logger targets respond to a given method
250
- #
251
- # @param method [Symbol] The method name to check
252
- # @param include_private [Boolean] Whether to include private methods
253
- # @return [Boolean] True if all logger targets respond to the method
254
- def respond_to_missing?(method, include_private = false)
255
- @targets.all? { |logger| logger.respond_to?(method, include_private) }
256
- end
257
-
258
- # Create a configured logger based on options
259
- #
260
- # This factory method creates a logger configured with appropriate formatters
261
- # and targets based on the provided options. By default, it creates a logger
262
- # that writes to both stdout (with colors) and a log file (plain text).
263
- #
264
- # @deprecated This method is deprecated and will be removed in version 0.2.0.
265
- # Use Makit::Logging::Logger.new with middleware instead.
266
- #
267
- # @param options [Hash] Logger configuration options
268
- # @option options [Symbol] :level (:info) The log level (:debug, :info, :warn, :error, :fatal)
269
- # @option options [Boolean] :file_logging (true) Whether to log to a file
270
- # @option options [String] :log_file (nil) Custom log file path, defaults to rake task-based path
271
- # @option options [Boolean] :structured_logging (false) Whether to use JSON structured logging for file output
272
- # @return [Logger, MultiLogger] A configured logger instance
273
- def self.create_logger(options = {})
274
- warn "Makit::Logging::MultiLogger.create_logger is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger.new with middleware instead."
275
- log_level = options[:level] || DEFAULT_LOG_LEVEL
276
- log_level = LOG_LEVELS[log_level] || LOG_LEVELS[DEFAULT_LOG_LEVEL]
277
-
278
- stdout_logger = ::Logger.new($stdout)
279
- stdout_logger.level = log_level
280
- stdout_logger.formatter = ColorFormatter.new
281
-
282
- # if clean or clobber commands are used, then log ONLY to stdout
283
- return stdout_logger if ARGV.include?("clean") || ARGV.include?("clobber")
284
-
285
- return stdout_logger if Makit::Environment.project_root_directory.nil?
286
-
287
- # Create file logger if logging to file is enabled
288
- if options[:file_logging] != false
289
- log_filename = create_log_filename(options)
290
- file_logger = create_file_logger(log_filename, log_level, options)
291
- return MultiLogger.new(file_logger, stdout_logger)
292
- end
293
-
294
- stdout_logger
295
- end
296
-
297
- # Create a file logger with appropriate formatter
298
- #
299
- # Creates a logger that writes to a file with the specified formatter
300
- # and log level. Ensures the directory for the log file exists.
301
- #
302
- # @param log_filename [String] Path where log file should be created
303
- # @param log_level [Integer] Log level to set (from Logger constants)
304
- # @param options [Hash] Configuration options
305
- # @option options [Boolean] :structured_logging (false) Whether to use JSON formatted logs
306
- # @return [Logger] Configured file logger
307
- def self.create_file_logger(log_filename, log_level, options)
308
- FileUtils.mkdir_p(File.dirname(log_filename))
309
-
310
- file_logger = ::Logger.new(log_filename)
311
- file_logger.level = log_level
312
-
313
- # Use structured logging for file output if requested
314
- file_logger.formatter = if options[:structured_logging]
315
- StructuredFormatter.new
316
- else
317
- PlainFormatter.new
318
- end
319
-
320
- file_logger
321
- end
322
-
323
- # Determine the appropriate log filename
324
- #
325
- # Generates a log filename based on options and the current rake task.
326
- # If a custom log file is specified in options, that is used. Otherwise,
327
- # a log file is created in the artifacts directory with a name based on
328
- # the current rake task.
329
- #
330
- # @param options [Hash] Configuration options
331
- # @option options [String] :log_file (nil) Custom log file path
332
- # @return [String] The path to use for the log file
333
- def self.create_log_filename(options)
334
- if options[:log_file]
335
- options[:log_file]
336
- elsif ARGV.empty?
337
- "#{Makit::Environment.project_root_directory}/artifacts/rake.log"
338
- else
339
- task_name = ARGV.join("_").gsub(":", "_")
340
- "#{Makit::Environment.project_root_directory}/artifacts/rake_#{task_name}.log"
341
- end
342
- end
343
- end
344
-
345
- # ===== DEPRECATED LEGACY LOGGING =====
346
- #
347
- # The following classes and methods are deprecated and will be removed in version 0.2.0:
348
- # - PlainFormatter
349
- # - ColorFormatter
350
- # - StructuredFormatter
351
- # - MultiLogger
352
- # - MultiLogger.create_logger
353
- #
354
- # MIGRATION GUIDE:
355
- #
356
- # OLD (deprecated):
357
- # logger = Makit::Logging::MultiLogger.create_logger
358
- # logger.info("message")
359
- #
360
- # NEW (recommended):
361
- # Makit::Logging.info("message") # Uses default logger
362
- # # OR
363
- # logger = Makit::Logging::Logger.new(sinks: [...])
364
- # logger.info("message")
365
- #
366
- # For custom formatting, use sinks:
367
- # logger = Makit::Logging::Logger.new(
368
- # sinks: [
369
- # Makit::Logging::Sinks::Console.new,
370
- # Makit::Logging::Sinks::FileSink.new(log_file: "app.log")
371
- # ]
372
- # )
373
-
374
- # ===== NEW LOGGING ARCHITECTURE =====
375
-
376
- # Default logger with unified file sink
377
- # This replaces the previous multi-sink approach with a single, configurable sink
378
- DEFAULT_LOGGER = Logger.new(
379
- level: current_log_level,
380
- sinks: [
381
- Sinks::UnifiedFileSink.new(
382
- configurations: [
383
- # Console output with colors and symbols
384
- {
385
- file: $stdout,
386
- format: :console,
387
- show_timestamp: false,
388
- show_level: false,
389
- },
390
- # Main log file in JSON format
391
- {
392
- file: "artifacts/makit.log",
393
- format: :json,
394
- append: true,
395
- include_metadata: true,
396
- },
397
- # Debug log file in text format
398
- {
399
- file: "artifacts/debug.log",
400
- format: :text,
401
- append: true,
402
- min_level: :debug,
403
- include_context: true,
404
- },
405
- ],
406
- ),
407
- ],
408
- )
409
-
410
- # Convenience methods that delegate to the default logger
411
- # These provide a simple API for common logging operations
412
-
413
- # Log an info message
414
- #
415
- # @param message [String] the log message
416
- # @param context [Hash] additional context information
417
- # @return [void]
418
- def self.info(message, context = {})
419
- DEFAULT_LOGGER.info(message, context)
420
- end
421
-
422
- # Log a success message
423
- #
424
- # @param message [String] the log message
425
- # @param context [Hash] additional context information
426
- # @return [void]
427
- def self.success(message, context = {})
428
- DEFAULT_LOGGER.success(message, context)
429
- end
430
-
431
- # Log an error message
432
- #
433
- # @param message [String] the log message
434
- # @param context [Hash] additional context information
435
- # @return [void]
436
- def self.error(message, context = {})
437
- DEFAULT_LOGGER.error(message, context)
438
- end
439
-
440
- # Log a warning message
441
- #
442
- # @param message [String] the log message
443
- # @param context [Hash] additional context information
444
- # @return [void]
445
- def self.warn(message, context = {})
446
- DEFAULT_LOGGER.warn(message, context)
447
- end
448
-
449
- # Log a debug message
450
- #
451
- # @param message [String] the log message
452
- # @param context [Hash] additional context information
453
- # @return [void]
454
- def self.debug(message, context = {})
455
- DEFAULT_LOGGER.debug(message, context)
456
- end
457
-
458
- # Log a fatal message
459
- #
460
- # @param message [String] the log message
461
- # @param context [Hash] additional context information
462
- # @return [void]
463
- def self.fatal(message, context = {})
464
- DEFAULT_LOGGER.fatal(message, context)
465
- end
466
-
467
- # Create a logger with environment-specific configuration
468
- #
469
- # @param environment [Symbol] environment name (:development, :production, :test, :ci)
470
- # @return [Logger] configured logger instance
471
- def self.create_logger(environment: :default)
472
- config = case environment
473
- when :development
474
- Configuration.development_config
475
- when :production
476
- Configuration.production_config
477
- when :test
478
- Configuration.test_config
479
- when :ci
480
- Configuration.ci_config
481
- else
482
- Configuration.default_config
483
- end
484
-
485
- Logger.new(
486
- sinks: [
487
- Sinks::UnifiedFileSink.new(configurations: config.configurations),
488
- ],
489
- )
490
- end
491
-
492
- # Create a logger from configuration file
493
- #
494
- # @param config_file [String] path to configuration file (YAML or JSON)
495
- # @return [Logger] configured logger instance
496
- def self.create_logger_from_file(config_file)
497
- config = if config_file.end_with?(".yaml") || config_file.end_with?(".yml")
498
- Configuration.from_yaml(config_file)
499
- elsif config_file.end_with?(".json")
500
- Configuration.from_json(config_file)
501
- else
502
- raise ArgumentError, "Configuration file must be YAML (.yaml/.yml) or JSON (.json)"
503
- end
504
-
505
- config.validate!
506
-
507
- Logger.new(
508
- sinks: [
509
- Sinks::UnifiedFileSink.new(configurations: config.configurations),
510
- ],
511
- )
512
- end
513
-
514
- # Get the default logger instance
515
- #
516
- # @return [Logger] the default logger
517
- def self.default_logger
518
- DEFAULT_LOGGER
519
- end
520
- end
521
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "logger"
4
+ begin
5
+ require "colorize"
6
+ rescue LoadError
7
+ # colorize gem not available, define a no-op colorize method
8
+ class String
9
+ def colorize(*args)
10
+ self
11
+ end
12
+ end
13
+ end
14
+ require_relative "symbols"
15
+ require_relative "logging/logger"
16
+ require_relative "logging/log_request"
17
+ require_relative "logging/sinks/base"
18
+ require_relative "logging/sinks/console"
19
+ require_relative "logging/sinks/file_sink"
20
+ require_relative "logging/sinks/structured"
21
+ require_relative "logging/sinks/unified_file_sink"
22
+ require_relative "logging/configuration"
23
+
24
+ # This module provides classes for the Makit gem.
25
+ module Makit
26
+ # Logging infrastructure for the Makit gem
27
+ #
28
+ # This module provides a comprehensive logging system with multiple formatters,
29
+ # multi-target output capabilities, and configurable log levels. It supports:
30
+ #
31
+ # - Plain text logging (suitable for files)
32
+ # - Colored console output (improved terminal readability)
33
+ # - Structured JSON logging (machine-parsable format)
34
+ # - Multi-target logging (write to multiple destinations simultaneously)
35
+ # - Sink-based output processing (similar to Commands::Runner)
36
+ #
37
+ # @deprecated The legacy MultiLogger, Formatter classes, and create_logger method
38
+ # are deprecated and will be removed in version 0.2.0. Use the new Logger class
39
+ # with sinks instead.
40
+ #
41
+ # @example Basic usage with new architecture (recommended)
42
+ # Makit::Logging.info("Application started")
43
+ # Makit::Logging.success("Build completed")
44
+ # Makit::Logging.error("Something went wrong")
45
+ #
46
+ # @example Custom logger configuration
47
+ # logger = Makit::Logging::Logger.new(
48
+ # sinks: [
49
+ # Makit::Logging::Sinks::Console.new,
50
+ # Makit::Logging::Sinks::FileSink.new(log_file: "custom.log")
51
+ # ]
52
+ # )
53
+ # logger.info("Custom message")
54
+ #
55
+ # @example Legacy usage (deprecated - will be removed in v0.2.0)
56
+ # logger = Makit::Logging::MultiLogger.create_logger
57
+ # logger.info("Application started")
58
+ # logger.error("Something went wrong")
59
+ module Logging
60
+ ANSI_COLOR_REGEX = /\e\[[0-9;]*m/
61
+
62
+ # Log levels that can be configured
63
+ LOG_LEVELS = {
64
+ debug: ::Logger::DEBUG,
65
+ info: ::Logger::INFO,
66
+ warn: ::Logger::WARN,
67
+ error: ::Logger::ERROR,
68
+ fatal: ::Logger::FATAL,
69
+ }.freeze
70
+
71
+ # Default log level
72
+ DEFAULT_LOG_LEVEL = :info
73
+
74
+ # Get the current log level from environment or use default
75
+ def self.current_log_level
76
+ env_level = ENV["LOG_LEVEL"]&.downcase&.to_sym
77
+ return env_level if env_level && LOG_LEVELS.key?(env_level)
78
+ DEFAULT_LOG_LEVEL
79
+ end
80
+
81
+ # Logs the duration of a rake task to a file
82
+ #
83
+ # This method calculates the elapsed time since the STARTTIME constant was set
84
+ # and appends this information to a log file. Used to track performance of rake tasks.
85
+ #
86
+ # @return [nil]
87
+ def self.log_rake_duration
88
+ # use the STARTTIME constant to log the duration of the rake task
89
+ # to the log/rake.duration.txt file
90
+ duration = Time.now - STARTTIME
91
+ FileUtils.mkdir_p("log")
92
+ File.open("log/rake.duration.txt", "a") do |file|
93
+ file.puts "Rake task duration: #{duration} seconds"
94
+ end
95
+ end
96
+
97
+ # Plain text log formatter that strips ANSI color codes
98
+ #
99
+ # This formatter removes color codes from log messages and provides
100
+ # clean, plain text output suitable for file logging or systems
101
+ # that don't support color output.
102
+ #
103
+ # @deprecated This class is deprecated and will be removed in version 0.2.0.
104
+ # Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink instead.
105
+ class PlainFormatter < ::Logger::Formatter
106
+ # Format a log message as plain text
107
+ #
108
+ # @param severity [String] log level (DEBUG, INFO, WARN, ERROR, FATAL)
109
+ # @param time [Time] timestamp of the log message
110
+ # @param _progname [String] program name (unused)
111
+ # @param msg [String] the log message content
112
+ # @return [String] formatted plain text log entry
113
+ def call(severity, time, _progname, msg)
114
+ warn "Makit::Logging::PlainFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink instead."
115
+ stripped_msg = msg.gsub(ANSI_COLOR_REGEX, "") # Remove ANSI color codes
116
+ timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
117
+ "[#{timestamp}] #{severity}: #{stripped_msg}\n"
118
+ end
119
+ end
120
+
121
+ # Colored log formatter for terminal output
122
+ #
123
+ # This formatter adds appropriate colors to different log levels
124
+ # to improve readability in terminal environments. Colors are:
125
+ # DEBUG (light blue), INFO (green), WARN (yellow), ERROR (red), FATAL (bold red)
126
+ #
127
+ # @deprecated This class is deprecated and will be removed in version 0.2.0.
128
+ # Use Makit::Logging::Logger with Makit::Logging::Sinks::Console instead.
129
+ class ColorFormatter < ::Logger::Formatter
130
+ # Format a log message with colors
131
+ #
132
+ # @param severity [String] log level (DEBUG, INFO, WARN, ERROR, FATAL)
133
+ # @param time [Time] timestamp of the log message
134
+ # @param _progname [String] program name (unused)
135
+ # @param msg [String] the log message content
136
+ # @return [String] formatted colored log entry
137
+ def call(severity, time, _progname, msg)
138
+ warn "Makit::Logging::ColorFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::Console instead."
139
+ timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
140
+ colored_severity = colorize_severity(severity)
141
+ "[#{timestamp}] #{colored_severity}: #{msg}\n"
142
+ end
143
+
144
+ private
145
+
146
+ def colorize_severity(severity)
147
+ case severity
148
+ when "DEBUG"
149
+ severity.light_blue
150
+ when "INFO"
151
+ severity.green
152
+ when "WARN"
153
+ severity.yellow
154
+ when "ERROR"
155
+ severity.red
156
+ when "FATAL"
157
+ severity.red.bold
158
+ else
159
+ severity
160
+ end
161
+ end
162
+ end
163
+
164
+ # Structured JSON log formatter
165
+ #
166
+ # This formatter outputs log messages as JSON objects with structured
167
+ # fields including timestamp, level, message, and program name.
168
+ # Useful for log aggregation systems and machine parsing.
169
+ #
170
+ # @deprecated This class is deprecated and will be removed in version 0.2.0.
171
+ # Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink (formatter: :json) instead.
172
+ class StructuredFormatter < ::Logger::Formatter
173
+ # Format a log message as JSON
174
+ #
175
+ # @param severity [String] log level (DEBUG, INFO, WARN, ERROR, FATAL)
176
+ # @param time [Time] timestamp of the log message
177
+ # @param progname [String] program name
178
+ # @param msg [String] the log message content
179
+ # @return [String] JSON formatted log entry with newline
180
+ def call(severity, time, progname, msg)
181
+ warn "Makit::Logging::StructuredFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink (formatter: :json) instead."
182
+ timestamp = time.strftime("%Y-%m-%d %H:%M:%S.%L")
183
+ {
184
+ timestamp: timestamp,
185
+ level: severity,
186
+ message: msg,
187
+ progname: progname,
188
+ }.to_json + "\n"
189
+ end
190
+ end
191
+
192
+ # Multi-target logger that writes to multiple destinations
193
+ #
194
+ # This logger allows writing log messages to multiple targets simultaneously,
195
+ # such as both stdout and a file, or multiple files with different formats.
196
+ #
197
+ # @deprecated This class is deprecated and will be removed in version 0.2.0.
198
+ # Use Makit::Logging::Logger with multiple middleware instead.
199
+ #
200
+ # @example Create a logger that writes to both console and file
201
+ # stdout_logger = Logger.new($stdout)
202
+ # file_logger = Logger.new("app.log")
203
+ # multi_logger = MultiLogger.new(stdout_logger, file_logger)
204
+ # multi_logger.info("This goes to both destinations")
205
+ class MultiLogger
206
+ # Initialize a new MultiLogger with multiple logging targets
207
+ #
208
+ # @param targets [Array<Logger>] One or more logger instances to write to
209
+ def initialize(*targets)
210
+ warn "Makit::Logging::MultiLogger is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with middleware instead."
211
+ @targets = targets
212
+ end
213
+
214
+ # Add a message to all logger targets
215
+ #
216
+ # @param severity [Integer] The severity level (::Logger::DEBUG, ::Logger::INFO, etc.)
217
+ # @param message [String, nil] The message to log (or nil if using block)
218
+ # @param progname [String, nil] The program name to include in the log
219
+ # @param block [Proc, nil] Optional block that returns the message to log
220
+ # @return [nil]
221
+ def add(severity, message = nil, progname = nil, &block)
222
+ @targets.each do |logger|
223
+ logger.add(severity, message, progname, &block)
224
+ logger.flush if logger.respond_to?(:flush)
225
+ end
226
+ end
227
+
228
+ # Append a message directly to all logger targets
229
+ #
230
+ # @param message [String] The message to append to all loggers
231
+ # @return [nil]
232
+ def <<(message)
233
+ @targets.each do |logger|
234
+ logger << message
235
+ logger.flush if logger.respond_to?(:flush)
236
+ end
237
+ end
238
+
239
+ # Close all logger targets
240
+ #
241
+ # @return [nil]
242
+ def close
243
+ @targets.each(&:close)
244
+ end
245
+
246
+ # Forward any unknown methods to all logger targets
247
+ #
248
+ # This allows calling standard Logger methods like info, debug, error, etc.
249
+ # directly on the MultiLogger instance.
250
+ #
251
+ # @param method [Symbol] The method name to forward
252
+ # @param args [Array] Arguments to pass to the method
253
+ # @return [nil]
254
+ def method_missing(method, ...)
255
+ @targets.each { |logger| logger.send(method, ...) }
256
+ end
257
+
258
+ # Check if all logger targets respond to a given method
259
+ #
260
+ # @param method [Symbol] The method name to check
261
+ # @param include_private [Boolean] Whether to include private methods
262
+ # @return [Boolean] True if all logger targets respond to the method
263
+ def respond_to_missing?(method, include_private = false)
264
+ @targets.all? { |logger| logger.respond_to?(method, include_private) }
265
+ end
266
+
267
+ # Create a configured logger based on options
268
+ #
269
+ # This factory method creates a logger configured with appropriate formatters
270
+ # and targets based on the provided options. By default, it creates a logger
271
+ # that writes to both stdout (with colors) and a log file (plain text).
272
+ #
273
+ # @deprecated This method is deprecated and will be removed in version 0.2.0.
274
+ # Use Makit::Logging::Logger.new with middleware instead.
275
+ #
276
+ # @param options [Hash] Logger configuration options
277
+ # @option options [Symbol] :level (:info) The log level (:debug, :info, :warn, :error, :fatal)
278
+ # @option options [Boolean] :file_logging (true) Whether to log to a file
279
+ # @option options [String] :log_file (nil) Custom log file path, defaults to rake task-based path
280
+ # @option options [Boolean] :structured_logging (false) Whether to use JSON structured logging for file output
281
+ # @return [Logger, MultiLogger] A configured logger instance
282
+ def self.create_logger(options = {})
283
+ warn "Makit::Logging::MultiLogger.create_logger is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger.new with middleware instead."
284
+ log_level = options[:level] || DEFAULT_LOG_LEVEL
285
+ log_level = LOG_LEVELS[log_level] || LOG_LEVELS[DEFAULT_LOG_LEVEL]
286
+
287
+ stdout_logger = ::Logger.new($stdout)
288
+ stdout_logger.level = log_level
289
+ stdout_logger.formatter = ColorFormatter.new
290
+
291
+ # if clean or clobber commands are used, then log ONLY to stdout
292
+ return stdout_logger if ARGV.include?("clean") || ARGV.include?("clobber")
293
+
294
+ return stdout_logger if Makit::Environment.project_root_directory.nil?
295
+
296
+ # Create file logger if logging to file is enabled
297
+ if options[:file_logging] != false
298
+ log_filename = create_log_filename(options)
299
+ file_logger = create_file_logger(log_filename, log_level, options)
300
+ return MultiLogger.new(file_logger, stdout_logger)
301
+ end
302
+
303
+ stdout_logger
304
+ end
305
+
306
+ # Create a file logger with appropriate formatter
307
+ #
308
+ # Creates a logger that writes to a file with the specified formatter
309
+ # and log level. Ensures the directory for the log file exists.
310
+ #
311
+ # @param log_filename [String] Path where log file should be created
312
+ # @param log_level [Integer] Log level to set (from Logger constants)
313
+ # @param options [Hash] Configuration options
314
+ # @option options [Boolean] :structured_logging (false) Whether to use JSON formatted logs
315
+ # @return [Logger] Configured file logger
316
+ def self.create_file_logger(log_filename, log_level, options)
317
+ FileUtils.mkdir_p(File.dirname(log_filename))
318
+
319
+ file_logger = ::Logger.new(log_filename)
320
+ file_logger.level = log_level
321
+
322
+ # Use structured logging for file output if requested
323
+ file_logger.formatter = if options[:structured_logging]
324
+ StructuredFormatter.new
325
+ else
326
+ PlainFormatter.new
327
+ end
328
+
329
+ file_logger
330
+ end
331
+
332
+ # Determine the appropriate log filename
333
+ #
334
+ # Generates a log filename based on options and the current rake task.
335
+ # If a custom log file is specified in options, that is used. Otherwise,
336
+ # a log file is created in the artifacts directory with a name based on
337
+ # the current rake task.
338
+ #
339
+ # @param options [Hash] Configuration options
340
+ # @option options [String] :log_file (nil) Custom log file path
341
+ # @return [String] The path to use for the log file
342
+ def self.create_log_filename(options)
343
+ if options[:log_file]
344
+ options[:log_file]
345
+ elsif ARGV.empty?
346
+ "#{Makit::Environment.project_root_directory}/artifacts/rake.log"
347
+ else
348
+ task_name = ARGV.join("_").gsub(":", "_")
349
+ "#{Makit::Environment.project_root_directory}/artifacts/rake_#{task_name}.log"
350
+ end
351
+ end
352
+ end
353
+
354
+ # ===== DEPRECATED LEGACY LOGGING =====
355
+ #
356
+ # The following classes and methods are deprecated and will be removed in version 0.2.0:
357
+ # - PlainFormatter
358
+ # - ColorFormatter
359
+ # - StructuredFormatter
360
+ # - MultiLogger
361
+ # - MultiLogger.create_logger
362
+ #
363
+ # MIGRATION GUIDE:
364
+ #
365
+ # OLD (deprecated):
366
+ # logger = Makit::Logging::MultiLogger.create_logger
367
+ # logger.info("message")
368
+ #
369
+ # NEW (recommended):
370
+ # Makit::Logging.info("message") # Uses default logger
371
+ # # OR
372
+ # logger = Makit::Logging::Logger.new(sinks: [...])
373
+ # logger.info("message")
374
+ #
375
+ # For custom formatting, use sinks:
376
+ # logger = Makit::Logging::Logger.new(
377
+ # sinks: [
378
+ # Makit::Logging::Sinks::Console.new,
379
+ # Makit::Logging::Sinks::FileSink.new(log_file: "app.log")
380
+ # ]
381
+ # )
382
+
383
+ # ===== NEW LOGGING ARCHITECTURE =====
384
+
385
+ # Default logger with unified file sink
386
+ # This replaces the previous multi-sink approach with a single, configurable sink
387
+ DEFAULT_LOGGER = Logger.new(
388
+ level: current_log_level,
389
+ sinks: [
390
+ Sinks::UnifiedFileSink.new(
391
+ configurations: [
392
+ # Console output with colors and symbols
393
+ {
394
+ file: $stdout,
395
+ format: :console,
396
+ show_timestamp: false,
397
+ show_level: false,
398
+ },
399
+ # Main log file in JSON format
400
+ {
401
+ file: "artifacts/makit.log",
402
+ format: :json,
403
+ append: true,
404
+ include_metadata: true,
405
+ },
406
+ # Debug log file in text format
407
+ {
408
+ file: "artifacts/debug.log",
409
+ format: :text,
410
+ append: true,
411
+ min_level: :debug,
412
+ include_context: true,
413
+ },
414
+ ],
415
+ ),
416
+ ],
417
+ )
418
+
419
+ # Convenience methods that delegate to the default logger
420
+ # These provide a simple API for common logging operations
421
+
422
+ # Log an info message
423
+ #
424
+ # @param message [String] the log message
425
+ # @param context [Hash] additional context information
426
+ # @return [void]
427
+ def self.info(message, context = {})
428
+ DEFAULT_LOGGER.info(message, context)
429
+ end
430
+
431
+ # Log a success message
432
+ #
433
+ # @param message [String] the log message
434
+ # @param context [Hash] additional context information
435
+ # @return [void]
436
+ def self.success(message, context = {})
437
+ DEFAULT_LOGGER.success(message, context)
438
+ end
439
+
440
+ # Log an error message
441
+ #
442
+ # @param message [String] the log message
443
+ # @param context [Hash] additional context information
444
+ # @return [void]
445
+ def self.error(message, context = {})
446
+ DEFAULT_LOGGER.error(message, context)
447
+ end
448
+
449
+ # Log a warning message
450
+ #
451
+ # @param message [String] the log message
452
+ # @param context [Hash] additional context information
453
+ # @return [void]
454
+ def self.warn(message, context = {})
455
+ DEFAULT_LOGGER.warn(message, context)
456
+ end
457
+
458
+ # Log a debug message
459
+ #
460
+ # @param message [String] the log message
461
+ # @param context [Hash] additional context information
462
+ # @return [void]
463
+ def self.debug(message, context = {})
464
+ DEFAULT_LOGGER.debug(message, context)
465
+ end
466
+
467
+ # Log a fatal message
468
+ #
469
+ # @param message [String] the log message
470
+ # @param context [Hash] additional context information
471
+ # @return [void]
472
+ def self.fatal(message, context = {})
473
+ DEFAULT_LOGGER.fatal(message, context)
474
+ end
475
+
476
+ # Create a logger with environment-specific configuration
477
+ #
478
+ # @param environment [Symbol] environment name (:development, :production, :test, :ci)
479
+ # @return [Logger] configured logger instance
480
+ def self.create_logger(environment: :default)
481
+ config = case environment
482
+ when :development
483
+ Configuration.development_config
484
+ when :production
485
+ Configuration.production_config
486
+ when :test
487
+ Configuration.test_config
488
+ when :ci
489
+ Configuration.ci_config
490
+ else
491
+ Configuration.default_config
492
+ end
493
+
494
+ Logger.new(
495
+ sinks: [
496
+ Sinks::UnifiedFileSink.new(configurations: config.configurations),
497
+ ],
498
+ )
499
+ end
500
+
501
+ # Create a logger from configuration file
502
+ #
503
+ # @param config_file [String] path to configuration file (YAML or JSON)
504
+ # @return [Logger] configured logger instance
505
+ def self.create_logger_from_file(config_file)
506
+ config = if config_file.end_with?(".yaml") || config_file.end_with?(".yml")
507
+ Configuration.from_yaml(config_file)
508
+ elsif config_file.end_with?(".json")
509
+ Configuration.from_json(config_file)
510
+ else
511
+ raise ArgumentError, "Configuration file must be YAML (.yaml/.yml) or JSON (.json)"
512
+ end
513
+
514
+ config.validate!
515
+
516
+ Logger.new(
517
+ sinks: [
518
+ Sinks::UnifiedFileSink.new(configurations: config.configurations),
519
+ ],
520
+ )
521
+ end
522
+
523
+ # Get the default logger instance
524
+ #
525
+ # @return [Logger] the default logger
526
+ def self.default_logger
527
+ DEFAULT_LOGGER
528
+ end
529
+ end
530
+ end