lib/rage/logger/logger.rb in rage-rb-0.5.2 vs lib/rage/logger/logger.rb in rage-rb-0.6.0
- old
+ new
@@ -54,11 +54,11 @@
# @param shift_age [Integer, String] number of old log files to keep, or frequency of rotation (`"daily"`, `"weekly"` or `"monthly"`). Default value is `0`, which disables log file rotation
# @param shift_size [Integer] maximum log file size in bytes (only applies when `shift_age` is a positive Integer)
# @param shift_period_suffix [String] the log file suffix format for daily, weekly or monthly rotation
# @param binmode sets whether the logger writes in binary mode
def initialize(log, level: Logger::DEBUG, formatter: Rage::TextFormatter.new, shift_age: 0, shift_size: 104857600, shift_period_suffix: "%Y%m%d", binmode: false)
- if log && log != File::NULL
- @logdev = Logger::LogDevice.new(log, shift_age:, shift_size:, shift_period_suffix:, binmode:)
+ @logdev = if log && log != File::NULL
+ Logger::LogDevice.new(log, shift_age:, shift_size:, shift_period_suffix:, binmode:)
end
@formatter = formatter
@level = level
define_log_methods