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