Class: Kitchen::Logger::SinkSet

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/logger.rb

Overview

Internal composite for forwarding stdlib Logger-compatible calls to all configured logging sinks.

Instance Method Summary collapse

Constructor Details

#initialize(loggers) ⇒ SinkSet

Returns a new instance of SinkSet.



340
341
342
# File 'lib/kitchen/logger.rb', line 340

def initialize(loggers)
  @loggers = loggers
end

Instance Method Details

#all(meth, *args, &block) ⇒ Object



348
349
350
351
352
353
# File 'lib/kitchen/logger.rb', line 348

def all(meth, *args, &block)
  result = nil
  block = memoized_block(block) if block
  @loggers.each { |logger| result = logger.public_send(meth, *args, &block) }
  result
end

#first(meth, *args, &block) ⇒ Object



344
345
346
# File 'lib/kitchen/logger.rb', line 344

def first(meth, *args, &block)
  @loggers.first.public_send(meth, *args, &block)
end