Module: AnjeaBackup::Logger

Included in:
Backup
Defined in:
lib/anjea_backup/logger.rb

Instance Method Summary collapse

Instance Method Details

#log(item, msg) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/anjea_backup/logger.rb', line 11

def log item, msg
  if item
    puts "[#{item.name}] #{now_with_minutes} - #{msg}"
  else
    puts "#{now_with_minutes} - #{msg}"
  end
end

#now_with_hourObject



7
8
9
# File 'lib/anjea_backup/logger.rb', line 7

def now_with_hour
  DateTime.now.strftime("%Y-%m-%d-%H")
end

#now_with_minutesObject



3
4
5
# File 'lib/anjea_backup/logger.rb', line 3

def now_with_minutes
  DateTime.now.strftime("%Y-%m-%d-%H-%M")
end