vendor/bundle/ruby/2.6.0/gems/lumberjack-1.2.8/lib/lumberjack/device/rolling_log_file.rb
# This is an abstract class for a device that appends entries to a file and periodically archives
# the existing file and starts a one. Subclasses must implement the roll_file? and archive_file_suffix
# methods.
#
# The :keep option can be used to specify a maximum number of rolled log files to keep.
# Older files will be deleted based on the time they were created. The default is to keep all files.
#
# The :min_roll_check option can be used to specify the number of seconds between checking
# the file to determine if it needs to be rolled. The default is to check at most once per second.
This is an abstract class for a device that appends entries to a file and periodically archives
the existing file and starts a one. Subclasses must implement the roll_file.

The :keep option can be used to specify a maximum number of rolled log files to keep.
Older files will be deleted based on the time they were created. The default is to keep all files.

The :min_roll_check option can be used to specify the number of seconds between checking
the file to determine if it needs to be rolled. The default is to check at most once per second.
This is an abstract class for a device that appends entries to a file and periodically archives the existing file and starts a one . Subclasses must implement the roll_file . The : keep option can be used to specify a maximum number of rolled log files to keep . Older files will be deleted based on the time they were created . The default is to keep all files . The : min_roll_check option can be used to specify the number of seconds between checking the file to determine if it needs to be rolled . The default is to check at most once per second .
def cleanup_files!
      if keep
        files = Dir.glob("#{path}.*").collect { |f| [f, File.ctime(f)] }.sort { |a, b| b.last <=> a.last }.collect { |a| a.first }
        if files.size > keep
          files[keep, files.length].each do |f|
            File.delete(f)
          end
        end
      end
    end
def cleanup_files! if keep files = Dir . glob ( "#{path}.*" ) . collect { | f | [ f , File . ctime ( f ) ] } . sort { | a , b | b . last <=> a . last } . collect { | a | a . first } if files . size > keep files [ keep , files . length ] . each do | f | File . delete ( f ) end end end end
This is an abstract class for a device that appends entries to a file and periodically archives
the existing file and starts a one.
This is an abstract class for a device that appends entries to a file and periodically archives the existing file and starts a one .