In Files

  • mkmf.rb

Class/Module Index [+]

Quicksearch

Logging

Public Class Methods

logfile(file) click to toggle source
 
               # File mkmf.rb, line 192
def self::logfile file
  @logfile = file
  if @log and not @log.closed?
    @log.flush
    @log.close
    @log = nil
  end
end
            
message(*s) click to toggle source
 
               # File mkmf.rb, line 186
def self::message(*s)
  @log ||= File::open(@logfile, 'w')
  @log.sync = true
  @log.printf(*s)
end
            
open() click to toggle source
 
               # File mkmf.rb, line 175
def self::open
  @log ||= File::open(@logfile, 'w')
  @log.sync = true
  $stderr.reopen(@log)
  $stdout.reopen(@log)
  yield
ensure
  $stderr.reopen(@orgerr)
  $stdout.reopen(@orgout)
end
            
postpone() click to toggle source
 
               # File mkmf.rb, line 201
def self::postpone
  tmplog = "mkmftmp#{@postpone += 1}.log"
  open do
    log, *save = @log, @logfile, @orgout, @orgerr
    @log, @logfile, @orgout, @orgerr = nil, tmplog, log, log
    begin
      log.print(open {yield})
      @log.close
      File::open(tmplog) {|t| FileUtils.copy_stream(t, log)}
    ensure
      @log, @logfile, @orgout, @orgerr = log, *save
      @postpone -= 1
      rm_f tmplog
    end
  end
end