Class: Flor::Logger::StdOut

Inherits:
Out
  • Object
show all
Defined in:
lib/flor/unit/logger.rb

Instance Attribute Summary

Attributes inherited from Out

#unit

Instance Method Summary collapse

Methods inherited from Out

#close, prepare

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

#flushObject



296
# File 'lib/flor/unit/logger.rb', line 296

def flush; @f.flush; end

#log_colours?Boolean

Returns:

  • (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


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