Class: EventLogger::Config
- Inherits:
-
Object
- Object
- EventLogger::Config
- Defined in:
- lib/event_logger/config.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #logger_instance ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 |
# File 'lib/event_logger/config.rb', line 10 def initialize self.logger = ENV.fetch('EVENT_LOGGER_LOGGER', :logger).to_sym end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/event_logger/config.rb', line 8 def logger @logger end |
Instance Method Details
#logger_instance ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/event_logger/config.rb', line 22 def logger_instance if logger == :logger EventLogger::Output::Logger.new(Logger.new(STDOUT)) elsif logger == :stdout EventLogger::Output::IO.new($stdout) elsif logger.respond_to?(:<<) EventLogger::Output::IO.new(logger) else EventLogger::Output::Logger.new(logger) end end |