Class: Assistor::LogFile

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/assistor/log_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_file) ⇒ LogFile

Returns a new instance of LogFile.



7
8
9
10
# File 'lib/assistor/log_file.rb', line 7

def initialize(log_file)
  @log_file = log_file
  @logger = Logger.new(log_file)
end

Instance Method Details

#reopenObject



12
13
14
15
16
# File 'lib/assistor/log_file.rb', line 12

def reopen
  $stderr.reopen @log_file, 'a+'
  $stdout.reopen $stderr
  $stdout.sync = $stderr.sync = true
end