def initialize(_name, hash={})
super( _name, hash.merge({:create => false}) )
if hash.has_key?(:maxsize) || hash.has_key?('maxsize')
_maxsize = (hash[:maxsize] or hash['maxsize']).to_i
if _maxsize.class != Fixnum
raise TypeError, "Argument 'maxsize' must be an Fixnum", caller
end
if _maxsize == 0
raise TypeError, "Argument 'maxsize' must be > 0", caller
end
@maxsize = _maxsize
end
if hash.has_key?(:maxtime) || hash.has_key?('maxtime')
_maxtime = (hash[:maxtime] or hash['maxtime']).to_i
if _maxtime.class != Fixnum
raise TypeError, "Argument 'maxtime' must be an Fixnum", caller
end
if _maxtime == 0
raise TypeError, "Argument 'maxtime' must be > 0", caller
end
@maxtime = _maxtime
end
if hash.has_key?(:max_backups) || hash.has_key?('max_backups')
_max_backups = (hash[:max_backups] or hash['max_backups']).to_i
if _max_backups.class != Fixnum
raise TypeError, "Argument 'max_backups' must be an Fixnum", caller
end
@max_backups = _max_backups
else
@max_backups = -1
end
@log_dir = File.dirname(@filename)
@file_extension = File.extname(@filename)
@core_file_name = File.basename(@filename, @file_extension)
if (@trunc)
purge_log_files(0)
end
@current_sequence_number = get_current_sequence_number()
makeNewFilename
open_log_file('a')
end