Class: Flor::Logger::Out

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

Direct Known Subclasses

FileOut, NoOut, StdOut

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit) ⇒ Out

Returns a new instance of Out.



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

def initialize(unit); @unit = unit; end

Instance Attribute Details

#unitObject (readonly)

Returns the value of attribute unit.



260
261
262
# File 'lib/flor/unit/logger.rb', line 260

def unit
  @unit
end

Class Method Details

.prepare(unit) ⇒ Object



268
269
270
271
272
273
274
275
276
277
# File 'lib/flor/unit/logger.rb', line 268

def self.prepare(unit)

  case o = unit.conf.fetch('log_out', 1)
  when false, 'null' then NoOut.new(unit)
  when 1, true, 'stdout' then StdOut.new(unit, $stdout)
  when 2, 'stderr' then StdOut.new(unit, $stderr)
  when /::/ then Flor.const_lookup(o).new(unit)
  else FileOut.new(unit, o)
  end
end

Instance Method Details

#closeObject



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

def close; end

#flushObject



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

def flush; end

#log_colours?Boolean

Returns:

  • (Boolean)


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

def log_colours?; @unit.conf.fetch('log_colours') { :no } == true; end

#puts(s) ⇒ Object



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

def puts(s); end