Class: Magellan::Logger

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(file_name = nil) ⇒ Logger

:nodoc:



4
5
6
7
# File 'lib/magellan/logger.rb', line 4

def initialize(file_name=nil) # :nodoc:
  @file_name = file_name
  File.open(@file_name, 'a') {} if @file_name
end

Instance Method Details

#update(time, passed, message) ⇒ Object

:nodoc:



9
10
11
12
13
# File 'lib/magellan/logger.rb', line 9

def update(time,passed,message)  # :nodoc:
  $stdout.putc(passed ? '.' : 'F')
  $stdout.flush
  File.open(@file_name, 'a') {|f| f.write(message + "\n") } if @file_name && !passed
end