Class: Tracing::CompositeLogger
- Inherits:
-
Logger
- Object
- Logger
- Tracing::CompositeLogger
- Defined in:
- lib/tracing/composite_logger.rb
Instance Attribute Summary collapse
-
#destinations ⇒ Object
readonly
Returns the value of attribute destinations.
Instance Method Summary collapse
- #add(*args, &block) ⇒ Object
-
#initialize(*loggers) ⇒ CompositeLogger
constructor
A new instance of CompositeLogger.
Constructor Details
#initialize(*loggers) ⇒ CompositeLogger
Returns a new instance of CompositeLogger.
5 6 7 8 |
# File 'lib/tracing/composite_logger.rb', line 5 def initialize(*loggers) super(nil) @destinations = loggers end |
Instance Attribute Details
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
3 4 5 |
# File 'lib/tracing/composite_logger.rb', line 3 def destinations @destinations end |
Instance Method Details
#add(*args, &block) ⇒ Object
10 11 12 |
# File 'lib/tracing/composite_logger.rb', line 10 def add(*args, &block) @destinations.each { |logger| logger.add(*args, &block) } end |