Class: Kitchen::Logger::SinkSet
- Inherits:
-
Object
- Object
- Kitchen::Logger::SinkSet
- Defined in:
- lib/kitchen/logger.rb
Overview
Internal composite for forwarding stdlib Logger-compatible calls to all configured logging sinks.
Instance Method Summary collapse
- #all(meth, *args, &block) ⇒ Object
- #first(meth, *args, &block) ⇒ Object
-
#initialize(loggers) ⇒ SinkSet
constructor
A new instance of SinkSet.
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 |