Module: Logging

Module | Logging
In: | mkmf.rb

### Methods

logfile message open postpone

### Public Class methods

logfile(file)

[Source]

    # File mkmf.rb, line 190
      def self::logfile file
        @logfile = file
        if @log and not @log.closed?
          @log.flush
          @log.close
          @log = nil
        end
      end

message(*s)

[Source]

    # File mkmf.rb, line 184
      def self::message(*s)
        @log ||= File::open(@logfile, 'w')
        @log.sync = true
        @log.printf(*s)
      end

open() {|| ...}

[Source]

    # File mkmf.rb, line 173
      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() {|| ...}

[Source]

    # File mkmf.rb, line 199
      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

[Validate]