new(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil)
public
Hide source
# File lib/logger.rb, line 670 def initialize(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil) @dev = @filename = @shift_age = @shift_size = @shift_period_suffix = nil mon_initialize set_dev(log) if @filename @shift_age = shift_age || 7 @shift_size = shift_size || 1048576 @shift_period_suffix = shift_period_suffix || '%Y%m%d' unless @shift_age.is_a?(Integer) base_time = @dev.respond_to?(:stat) ? @dev.stat.mtime : Time.now @next_rotate_time = next_rotate_time(base_time, @shift_age) end end end