Class: Kitchen::Terraform::DebugLogger

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/kitchen/terraform/debug_logger.rb

Overview

This class delegates to a logger but ensures the debug level is the default level used for logging messages.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(obj) ⇒ Kitchen::Terraform::DebugLogger

.new creates a new instance of the class.



27
28
29
30
31
32
33
# File 'lib/kitchen/terraform/debug_logger.rb', line 27

def new(obj)
  if !obj.kind_of? ::Kitchen::Logger
    raise ::TypeError, "delegate must be a Kitchen::Logger; recevied #{obj.class}"
  end

  super
end

Instance Method Details

#<<(message) ⇒ nil, true

This method overrides the #<< method of the delegate to call #debug.

Parameters:

  • message (#to_s)

    the message to be logged.

Returns:

  • (nil, true)

    if the given severity is high enough for this particular logger then return nil; else return true.



41
42
43
# File 'lib/kitchen/terraform/debug_logger.rb', line 41

def <<(message)
  debug message
end