Class: Backup::Logger::Logfile

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

Defined Under Namespace

Classes: Error, Options

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Logfile

Returns a new instance of Logfile.



80
81
82
83
84
# File 'lib/backup/logger/logfile.rb', line 80

def initialize(options)
  @options = options
  @logfile = setup_logfile
  truncate!
end

Instance Method Details

#log(message) ⇒ Object



86
87
88
# File 'lib/backup/logger/logfile.rb', line 86

def log(message)
  File.open(@logfile, 'a') {|f| f.puts message.formatted_lines }
end