Class: Inspec::Log

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

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Log

Returns a new instance of Log.



10
11
12
# File 'lib/inspec/log.rb', line 10

def initialize(opts = {})
  @quiet = opts[:quiet] || false
end

Instance Method Details

#error(msg) ⇒ Object



22
23
24
# File 'lib/inspec/log.rb', line 22

def error(msg)
  show ''.color(:red).bright + msg
end

#info(msg) ⇒ Object



18
19
20
# File 'lib/inspec/log.rb', line 18

def info(msg)
  show '  .  '.color(:white) + msg
end

#ok(msg) ⇒ Object



30
31
32
# File 'lib/inspec/log.rb', line 30

def ok(msg)
  show ''.color(:green).bright + msg
end

#show(msg) ⇒ Object



14
15
16
# File 'lib/inspec/log.rb', line 14

def show(msg)
  puts msg unless @quiet
end

#warn(msg) ⇒ Object



26
27
28
# File 'lib/inspec/log.rb', line 26

def warn(msg)
  show '  !  '.color(:yellow).bright + msg
end