Class: Sprout::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/sprout/log.rb

Constant Summary

@@debug =
false
@@output =
''
@@printout =
''

Class Method Summary (collapse)

Class Method Details

+ (Object) debug



12
13
14
# File 'lib/sprout/log.rb', line 12

def Log.debug
  return @@debug
end

+ (Object) debug=(debug)



8
9
10
# File 'lib/sprout/log.rb', line 8

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

+ (Object) flush



38
39
40
41
42
43
# File 'lib/sprout/log.rb', line 38

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

+ (Object) flush_print



31
32
33
34
35
36
# File 'lib/sprout/log.rb', line 31

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


21
22
23
24
# File 'lib/sprout/log.rb', line 21

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

+ (Object) printf(msg)



26
27
28
29
# File 'lib/sprout/log.rb', line 26

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

+ (Object) puts(msg)



16
17
18
19
# File 'lib/sprout/log.rb', line 16

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