Sha256: 3ec94e267c743c00bf97b998ca22761242d0f80b9cd65e0f3a8ab92bdb1214d3

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

module Sprout
  class Log
    @@debug = false
    @@output = ''
    @@printout = ''

    def Log.debug=(debug)
      @@debug = debug
    end

    def Log.debug
      return @@debug
    end

    def Log.puts(msg)
      @@output << msg + "\n"
      Log.flush
    end

    def Log.print(msg)
      @@printout << msg
      Log.flush_print
    end

    def Log.printf(msg)
      @@printout << msg
      Log.flush_print
    end

    def Log.flush_print
      if(!Log.debug)
        $stdout.printf @@printout
        @@printout = ''
      end
    end

    def Log.flush
      if(!Log.debug)
        $stdout.printf @@output
        @@output = ''
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sprout-1.0.35.pre lib/sprout/log.rb