Class: Flor::Logger::FileOut
Instance Attribute Summary
Attributes inherited from Out
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(unit, dir) ⇒ FileOut
constructor
A new instance of FileOut.
- #puts(s) ⇒ Object
Methods inherited from Out
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
#close ⇒ Object
312 |
# File 'lib/flor/unit/logger.rb', line 312 def close; @mutex.synchronize { @file.close if @file }; end |
#flush ⇒ Object
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 |