Module: BioDSL::LogHelper

Included in:
Pipeline
Defined in:
lib/BioDSL/helpers/log_helper.rb

Overview

Namespace for LogHelper.

Instance Method Summary collapse

Instance Method Details

#log_error(exception) ⇒ Object

Log an ERROR messge to the log file.



45
46
47
48
49
50
51
52
53
# File 'lib/BioDSL/helpers/log_helper.rb', line 45

def log_error(exception)
  File.open(BioDSL::Config::LOG_FILE, 'a') do |ios|
    ios.puts to_s
    ios.puts status.to_yaml if self.respond_to? :status
    ios.puts 'ERROR'
    ios.puts exception.message
    ios.puts exception.backtrace
  end
end

#log_okObject

Log an OK messge to the log file.



34
35
36
37
38
39
40
41
42
# File 'lib/BioDSL/helpers/log_helper.rb', line 34

def log_ok
  return if BioDSL.test

  File.open(BioDSL::Config::LOG_FILE, 'a') do |ios|
    ios.puts to_s
    ios.puts status.to_yaml
    ios.puts 'OK'
  end
end