module BioDSL::LogHelper

Namespace for LogHelper.

Public Instance Methods

log_error(exception) click to toggle source

Log an ERROR messge to the log file.

# 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_ok() click to toggle source

Log an OK messge to the log file.

# 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