# Logging (Module)

In: | mkmf.rb

## Methods

logfile message open postpone

## Public Class methods

open() {|| ...}

[Source]

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

message(*s)

[Source]

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

logfile(file)

[Source]

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

postpone() {|})| ...}

[Source]

    # File mkmf.rb, line 148
      def self::postpone
        tmplog = "mkmftmp.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
            rm_f tmplog
          end
        end
      end

[Validate]