Class: BuildpackSupport::Logging::DelegatingLogger
- Inherits:
-
Logger
- Object
- Logger
- BuildpackSupport::Logging::DelegatingLogger
- Defined in:
- lib/buildpack_support/logging/delegating_logger.rb
Overview
A Logger
subclass that forwards all messages to a collection of delegates
Instance Method Summary collapse
-
#add(severity, message = nil, progname = nil) { ... } ⇒ Void
Adds a message to the delegate
Logger
instances. -
#initialize(klass, delegates) ⇒ DelegatingLogger
constructor
Creates an instance.
Constructor Details
#initialize(klass, delegates) ⇒ DelegatingLogger
Creates an instance
29 30 31 32 |
# File 'lib/buildpack_support/logging/delegating_logger.rb', line 29 def initialize(klass, delegates) @klass = klass @delegates = delegates end |
Instance Method Details
#add(severity, message = nil, progname = nil) { ... } ⇒ Void
Adds a message to the delegate Logger
instances
41 42 43 |
# File 'lib/buildpack_support/logging/delegating_logger.rb', line 41 def add(severity, = nil, progname = nil, &block) @delegates.each { |delegate| delegate.add severity, || progname, @klass, &block } end |