Module: Logput::Adapters
- Defined in:
- lib/logput/adapters.rb,
lib/logput/adapters/base.rb,
lib/logput/adapters/logger.rb,
lib/logput/adapters/tagged_logging.rb
Overview
Logging Adapters
Defined Under Namespace
Classes: Base, Logger, TaggedLogging
Class Method Summary collapse
-
.obtain(logger) ⇒ Adapter
Find a registered adapter.
-
.registered_adapters ⇒ Hash
Currently registered adapters.
Class Method Details
.obtain(logger) ⇒ Adapter
Find a registered adapter
12 13 14 15 16 17 |
# File 'lib/logput/adapters.rb', line 12 def self.obtain(logger) registered_adapters.each do |_, adapter| return adapter.new(logger) if adapter.handles?(logger) end raise "#{logger} is not supported." end |
.registered_adapters ⇒ Hash
Returns Currently registered adapters.
6 7 8 |
# File 'lib/logput/adapters.rb', line 6 def self.registered_adapters @registered_adapters ||= {} end |