Class: FCSHD::Logger
- Inherits:
-
Object
- Object
- FCSHD::Logger
- Defined in:
- lib/fcshd/logger.rb
Instance Method Summary collapse
- #die(message) ⇒ Object
- #dump(output) ⇒ Object
- #error(message) ⇒ Object
-
#initialize(output) ⇒ Logger
constructor
A new instance of Logger.
- #log(message) ⇒ Object
Constructor Details
#initialize(output) ⇒ Logger
Returns a new instance of Logger.
3 4 5 |
# File 'lib/fcshd/logger.rb', line 3 def initialize(output) @output = output end |
Instance Method Details
#die(message) ⇒ Object
23 24 25 26 |
# File 'lib/fcshd/logger.rb', line 23 def die() error exit 1 end |
#dump(output) ⇒ Object
13 14 15 |
# File 'lib/fcshd/logger.rb', line 13 def dump(output) @output.puts output.chomp end |
#error(message) ⇒ Object
17 18 19 20 21 |
# File 'lib/fcshd/logger.rb', line 17 def error() for line in .lines log "error: #{line.chomp}" end end |
#log(message) ⇒ Object
7 8 9 10 11 |
# File 'lib/fcshd/logger.rb', line 7 def log() for line in .lines @output.puts "#{File.basename($0)}: #{line.chomp}" end end |