Module: Loggr::Support::Annotations

Defined in:
lib/loggr/support/annotations.rb

Defined Under Namespace

Modules: NOPSupport

Class Method Summary collapse

Class Method Details

.enhance(logger) ⇒ Object

Enhances supplied logger with the required features to handle both `tagged` and `mapped` on the logger itself.


19
20
21
22
23
# File 'lib/loggr/support/annotations.rb', line 19

def self.enhance(logger)
  return logger if logger.respond_to?(:tagged) && logger.respond_to?(:mapped)
  return ::ActiveSupport::TaggedLogging.new(logger) if defined?(::ActiveSupport::TaggedLogging)
  logger.send(:extend, NOPSupport)
end