2015-09-03 20:36:46 +02:00
|
|
|
# encoding: utf-8
|
2015-06-07 21:41:54 +02:00
|
|
|
# Copyright 2015 Dominik Richter. All rights reserved.
|
|
|
|
require 'rainbow/ext/string'
|
|
|
|
|
|
|
|
module Vulcano
|
|
|
|
class Log
|
2015-09-03 20:43:58 +02:00
|
|
|
def initialize(opts = {})
|
2015-06-07 21:41:54 +02:00
|
|
|
@quiet = opts[:quiet] || false
|
|
|
|
end
|
|
|
|
|
2015-09-03 20:43:58 +02:00
|
|
|
def show(msg)
|
2015-06-07 21:41:54 +02:00
|
|
|
puts msg unless @quiet
|
|
|
|
end
|
|
|
|
|
2015-09-03 20:43:58 +02:00
|
|
|
def info(msg)
|
2015-09-03 20:35:23 +02:00
|
|
|
show ' . '.color(:white) + msg
|
2015-06-16 23:33:27 +02:00
|
|
|
end
|
|
|
|
|
2015-09-03 20:43:58 +02:00
|
|
|
def error(msg)
|
2015-09-03 20:35:23 +02:00
|
|
|
show ' ✖ '.color(:red).bright + msg
|
2015-06-07 21:41:54 +02:00
|
|
|
end
|
|
|
|
|
2015-09-03 20:43:58 +02:00
|
|
|
def warn(msg)
|
2015-09-03 20:35:23 +02:00
|
|
|
show ' ! '.color(:yellow).bright + msg
|
2015-06-07 21:41:54 +02:00
|
|
|
end
|
|
|
|
|
2015-09-03 20:43:58 +02:00
|
|
|
def ok(msg)
|
2015-09-03 20:35:23 +02:00
|
|
|
show ' ✔ '.color(:green).bright + msg
|
2015-06-07 21:41:54 +02:00
|
|
|
end
|
|
|
|
end
|
2015-09-03 20:43:58 +02:00
|
|
|
end
|