FileOutputter
Additional hash arguments are:
Directory of the log file
Time.strftime format string (default is "%Y-%m-%d")
# File lib/log4r/outputter/datefileoutputter.rb, line 47 def initialize(_name, hash={}) @DatePattern = (hash[:date_pattern] or hash['date_pattern'] or DEFAULT_DATE_FMT) @DateStamp = Time.now.strftime( @DatePattern); _dirname = (hash[:dirname] or hash['dirname']) # hash[:dirname] masks hash[:filename] if _dirname if not FileTest.directory?( _dirname) raise StandardError, "'#{_dirname}' must be a valid directory", caller end end _filename = (hash[:filename] or hash['filename']) if _filename.nil? @filebase = File.basename( $0, '.rb') + ".log" else @filebase = File.basename((hash[:filename] or hash['filename'] or "")) end # Get rid of the 'nil' in the path path = [_dirname, @filebase.sub(/(\.\w*)$/, "_#{@DateStamp}" + '\1')].compact hash[:filename] = hash['filename'] = File.join(path) super(_name, hash) end
Generated with the Darkfish Rdoc Generator 2.