Class: Kitchen::Provisioner::Puppet::Librarian::LoggerUI

Inherits:
Librarian::UI
  • Object
show all
Defined in:
lib/kitchen/provisioner/puppet/librarian.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ LoggerUI

Returns a new instance of LoggerUI.



36
37
38
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 36

def initialize(logger)
  @logger = logger
end

Instance Attribute Details

#logger=(value) ⇒ Object (writeonly)

Sets the attribute logger

Parameters:

  • value

    the value to set the attribute logger to.



34
35
36
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 34

def logger=(value)
  @logger = value
end

Instance Method Details

#confirm(message = nil) ⇒ Object



56
57
58
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 56

def confirm(message = nil)
  @logger.info(message || yield)
end

#debug(message = nil) ⇒ Object



44
45
46
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 44

def debug(message = nil)
  @logger.debug(message || yield)
end

#error(message = nil) ⇒ Object



48
49
50
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 48

def error(message = nil)
  @logger.error(message || yield)
end

#info(message = nil) ⇒ Object



52
53
54
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 52

def info(message = nil)
  @logger.info(message || yield)
end

#warn(message = nil) ⇒ Object



40
41
42
# File 'lib/kitchen/provisioner/puppet/librarian.rb', line 40

def warn(message = nil)
  @logger.warn(message || yield)
end