8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/salt-lint/printer.rb', line 8
def self.print(msg_type = 'info', message = 'no message specified', debug_level = 0)
prefix = nil
show = true
kill = false
case msg_type
when 'debug'
prefix = '[d]'
color = 'light_black'
show = false
when 'warning'
prefix = '[!]'
color = 'yellow'
when 'error'
prefix = '[!!!]'
color = 'red'
kill = true
when 'question'
prefix = '[?]'
color = 'light_blue'
when 'success'
prefix = '[:)]'
color = 'light_green'
else
prefix = '[i]'
color = 'white'
end
if msg_type == 'debug' and $debug != false and debug_level <= $debug
show = true
end
if show == true
puts "#{prefix} #{message}".send(color.to_sym)
end
end
|