Module: ActivePublisher::Logging
- Included in:
- Async::InMemoryAdapter::Adapter, Async::InMemoryAdapter::AsyncQueue, Async::RedisAdapter::Adapter
- Defined in:
- lib/active_publisher/logging.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.initialize_logger(log_target = STDOUT) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/active_publisher/logging.rb', line 7 def self.initialize_logger(log_target = STDOUT) oldlogger = defined?(@logger) ? @logger : nil @logger = Logger.new(log_target) @logger.level = Logger::INFO oldlogger.close if oldlogger && !$TESTING # don't want to close testing's STDOUT logging @logger end |
.logger ⇒ Object
15 16 17 |
# File 'lib/active_publisher/logging.rb', line 15 def self.logger defined?(@logger) ? @logger : initialize_logger end |
.logger=(log) ⇒ Object
19 20 21 |
# File 'lib/active_publisher/logging.rb', line 19 def self.logger=(log) @logger = (log ? log : Logger.new("/dev/null")) end |
Instance Method Details
#logger ⇒ Object
23 24 25 |
# File 'lib/active_publisher/logging.rb', line 23 def logger ::ActivePublisher::Logging.logger end |