Module: RightSupport::Log::Mixin::ClassMethods

Defined in:
lib/right_support/log/mixin.rb

Overview

Class methods that become available to classes that include Mixin.

Instance Method Summary collapse

Instance Method Details

#loggerObject



74
75
76
77
78
79
80
81
82
# File 'lib/right_support/log/mixin.rb', line 74

def logger
  if @logger
    @logger
  elsif scl = (respond_to?(:superclass) && superclass.respond_to?(:logger) && !UNDELEGATED.include?(superclass) && superclass.logger)
    scl
  else
    RightSupport::Log::Mixin.default_logger
  end
end

#logger=(logger) ⇒ Object



84
85
86
87
# File 'lib/right_support/log/mixin.rb', line 84

def logger=(logger)
  logger = Decorator.new(logger) unless logger.nil? || logger.is_a?(Decorator)
  @logger = logger
end