lib/config/factory/log.rb in config-factory-0.0.9 vs lib/config/factory/log.rb in config-factory-0.1.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'logger'
module Config
module Factory
@@ -18,18 +20,17 @@
# @param value [IO] the log device
def self.log_device=(value)
@log = new_logger(logdev: value)
end
- private
-
def self.new_logger(logdev:, level: Logger::DEBUG, shift_age: 10, shift_size: 1024 * 1024)
logger = Logger.new(logdev, shift_age, shift_size)
logger.level = level
logger.formatter = proc do |severity, datetime, progname, msg|
"#{datetime.to_time.utc} #{severity} -#{progname}- #{msg}\n"
end
logger
end
+ private_class_method :new_logger
end
end