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.



78
79
80
81
82
# File 'lib/backup/logger/logfile.rb', line 78

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

Instance Method Details

#log(message) ⇒ Object



84
85
86
# File 'lib/backup/logger/logfile.rb', line 84

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