vendor/bundle/ruby/2.6.0/gems/lumberjack-1.2.8/lib/lumberjack/device/rolling_log_file.rb
# Roll the log file by renaming it to the archive file name and then re-opening a stream to the log
# file path. Rolling a file is safe in multi-threaded or multi-process environments.
Roll the log file by renaming it to the archive file name and then re-opening a stream to the log
file path. Rolling a file is safe in multi-threaded or multi-process environments.
Roll the log file by renaming it to the archive file name and then re - opening a stream to the log file path . Rolling a file is safe in multi - threaded or multi - process environments .
def roll_file! 
        do_once(stream) do
          archive_file = "#{path}.#{archive_file_suffix}"
          stream.flush
          current_inode = begin
                            File.stat(path).ino
                          rescue
                            nil
                          end
          if @file_inode && current_inode == @file_inode && !File.exist?(archive_file) && File.exist?(path)
            begin
              File.rename(path, archive_file)
              after_roll
              cleanup_files!
            rescue SystemCallError
            end
          end
          reopen_file
        end
      rescue => e
        $stderr.write("Failed to roll file #{path}: #{e.inspect}\n#{e.backtrace.join("\n")}\n")
      end
def roll_file! do_once ( stream ) do archive_file = "#{path}.#{archive_file_suffix}" stream . flush current_inode = begin File . stat ( path ) . ino rescue nil end if @file_inode && current_inode == @file_inode && ! File . exist? ( archive_file ) && File . exist? ( path ) begin File . rename ( path , archive_file ) after_roll cleanup_files! rescue SystemCallError end end reopen_file end rescue => e $stderr . write ( "Failed to roll file #{path}: #{e.inspect}\n#{e.backtrace.join("\n")}\n" ) end
Roll the log file by renaming it to the archive file name and then re-opening a stream to the log
file path.
Roll the log file by renaming it to the archive file name and then re - opening a stream to the log file path .
#:nodoc: # Ignore rename errors since it indicates the file was already rolled