class Puma::Runner

def redirect_io

def redirect_io
  stdout = @options[:redirect_stdout]
  stderr = @options[:redirect_stderr]
  append = @options[:redirect_append]
  if stdout
    unless Dir.exist?(File.dirname(stdout))
      raise "Cannot redirect STDOUT to #{stdout}"
    end
    STDOUT.reopen stdout, (append ? "a" : "w")
    STDOUT.sync = true
    STDOUT.puts "=== puma startup: #{Time.now} ==="
  end
  if stderr
    unless Dir.exist?(File.dirname(stderr))
      raise "Cannot redirect STDERR to #{stderr}"
    end
    STDERR.reopen stderr, (append ? "a" : "w")
    STDERR.sync = true
    STDERR.puts "=== puma startup: #{Time.now} ==="
  end
end