Class: Sprout::Log

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

Overview

:nodoc:

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.debugObject



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

def Log.debug
  return @@debug
end

.debug=(debug) ⇒ Object



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

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

.flushObject



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

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

.flush_printObject



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

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


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

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

.printf(msg) ⇒ Object



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

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

.puts(msg) ⇒ Object



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

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