Class: Flor::Logger::StdOut
Instance Attribute Summary
Attributes inherited from Out
Instance Method Summary collapse
- #<<(s) ⇒ Object
- #flush ⇒ Object
-
#initialize(unit, f) ⇒ StdOut
constructor
A new instance of StdOut.
- #log_colours? ⇒ Boolean
- #print(s) ⇒ Object
- #puts(s) ⇒ Object
Methods inherited from Out
Constructor Details
#initialize(unit, f) ⇒ StdOut
Returns a new instance of StdOut.
287 |
# File 'lib/flor/unit/logger.rb', line 287 def initialize(unit, f); super(unit); @f = f; end |
Instance Method Details
#<<(s) ⇒ Object
293 |
# File 'lib/flor/unit/logger.rb', line 293 def <<(s); @f << s; self; end |
#flush ⇒ Object
296 |
# File 'lib/flor/unit/logger.rb', line 296 def flush; @f.flush; end |
#log_colours? ⇒ Boolean
288 289 290 291 292 |
# File 'lib/flor/unit/logger.rb', line 288 def log_colours? lc = @unit.conf.fetch('log_colours') { :no } return lc if [ true, false ].include?(lc) @f.tty? end |
#print(s) ⇒ Object
294 |
# File 'lib/flor/unit/logger.rb', line 294 def print(s); @f.print(s); end |
#puts(s) ⇒ Object
295 |
# File 'lib/flor/unit/logger.rb', line 295 def puts(s); @f.puts(s); end |