Class: Asca::Tools::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/asca/tools/log.rb

Defined Under Namespace

Classes: Color

Class Method Summary collapse

Class Method Details

.command(message) ⇒ Object



45
46
47
# File 'lib/asca/tools/log.rb', line 45

def command message
puts "#{Color.command}RUN: \e[4m#{message}#{Color.reset}"
end

.error(message) ⇒ Object



41
42
43
# File 'lib/asca/tools/log.rb', line 41

def error message
puts "#{Color.error}ERROR: #{message}#{Color.reset}", STDERR
end

.info(message) ⇒ Object



37
38
39
# File 'lib/asca/tools/log.rb', line 37

def info message
puts "#{Color.info}INFO: #{message}#{Color.reset}"
end

.puts(message, io = STDOUT) ⇒ Object



49
50
51
# File 'lib/asca/tools/log.rb', line 49

def puts message, io = STDOUT
io.puts "#{Color.time}[#{Time.new}]#{Color.reset} #{message}"
end

.warn(message) ⇒ Object



33
34
35
# File 'lib/asca/tools/log.rb', line 33

def warn message
puts "#{Color.warn}WARN: #{message}#{Color.reset}"
end