Class: Flor::Logger::FileOut

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

#log_colours?, prepare

Constructor Details

#initialize(unit, dir) ⇒ FileOut

Returns a new instance of FileOut.



301
302
303
304
305
306
307
308
309
# File 'lib/flor/unit/logger.rb', line 301

def initialize(unit, dir)

  super(unit)
  @dir = dir

  @mutex = Mutex.new
  @file = nil
  @fname = nil
end

Instance Method Details

#closeObject



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

def close; @mutex.synchronize { @file.close if @file }; end

#flushObject



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

def flush; @mutex.synchronize { @file.flush if @file }; end

#puts(s) ⇒ Object



314
315
316
# File 'lib/flor/unit/logger.rb', line 314

def puts(s)
  @mutex.synchronize { prepare_file.puts(s) }
end