Class: Sprout::Log
- Inherits:
-
Object
- Object
- Sprout::Log
- Defined in:
- lib/sprout/log.rb
Overview
:nodoc:
Constant Summary collapse
- @@debug =
false- @@output =
''- @@printout =
''
Class Method Summary collapse
- .debug ⇒ Object
- .debug=(debug) ⇒ Object
- .flush ⇒ Object
- .flush_print ⇒ Object
- .print(msg) ⇒ Object
- .printf(msg) ⇒ Object
- .puts(msg) ⇒ Object
Class Method Details
.debug ⇒ Object
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 |
.flush ⇒ Object
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_print ⇒ Object
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 |
.print(msg) ⇒ Object
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 |