class Lumberjack::Device::SizeRollingLogFile
def initialize(path, options = {})
Create an new log device to the specified file. The maximum size of the log file is specified with
def initialize(path, options = {}) @manual = options[:manual] @max_size = options[:max_size] if @max_size.is_a?(String) if @max_size =~ /^(\d+(\.\d+)?)([KMG])?$/i @max_size = $~[1].to_f units = $~[3].to_s.upcase case units when "K" @max_size *= 1024 when "M" @max_size *= 1024**2 when "G" @max_size *= 1024**3 end @max_size = @max_size.round else raise ArgumentError.new("illegal value for :max_size (#{@max_size})") end end super end