# File lib/logging/appenders/file.rb, line 49 def initialize( name, opts = {} ) @fn = opts.getopt(:filename, name) raise ArgumentError, 'no filename was given' if @fn.nil? @fn = ::File.expand_path(@fn) self.class.assert_valid_logfile(@fn) @mode = opts.getopt(:truncate) ? 'w' : 'a' self.encoding = opts.fetch(:encoding, self.encoding) @mode = "#{@mode}:#{self.encoding}" if self.encoding super(name, ::File.new(@fn, @mode), opts) end