class Papa::Helper::Logger

Public Class Methods

log(message) click to toggle source
# File lib/papa/helper/logger.rb, line 4
def self.log(message)
  File.open(log_path, 'a+') do |file|
    file.puts message
  end
end
log_path() click to toggle source
# File lib/papa/helper/logger.rb, line 10
def self.log_path
  return @log_path if defined?(@log_path)
  command = ARGV.first(2).join('_')
  timestamp = Time.now.strftime('%Y_%m_%d_%I_%M_%S')
  @log_path = [timestamp, 'papa', command].join('_') + '.log'
end