Sha256: 4bd0cdebc0fc201c13a6e4a29905ffcbca68720384754f3389596905ae07f8a4

Contents?: true

Size: 650 Bytes

Versions: 61

Compression:

Stored size: 650 Bytes

Contents

module Sapience
  # rubocop:disable TrivialAccessors
  module Loggable
    def self.included(base)
      base.send(:extend, Extensions)
    end

    # Returns [Sapience::Logger] instance level logger
    def logger
      @logger ||= self.class.logger
    end

    # Replace instance level logger
    def logger=(logger)
      @logger = logger
    end

    module Extensions
      # Returns [Sapience::Logger] class level logger
      def logger
        @logger ||= Sapience[self]
      end

      # Replace instance class level logger
      def logger=(logger)
        @logger = logger
      end
    end
  end
  # rubocop:enable TrivialAccessors
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
sapience-2.4.0 lib/sapience/loggable.rb
sapience-2.3.5 lib/sapience/loggable.rb
sapience-2.3.4 lib/sapience/loggable.rb
sapience-2.3.3 lib/sapience/loggable.rb
sapience-2.2.3 lib/sapience/loggable.rb
sapience-2.2.1 lib/sapience/loggable.rb
sapience-2.2.0 lib/sapience/loggable.rb
sapience-2.1.0 lib/sapience/loggable.rb
sapience-2.0.5 lib/sapience/loggable.rb
sapience-2.0.4 lib/sapience/loggable.rb
sapience-2.0.3 lib/sapience/loggable.rb
sapience-2.0.2 lib/sapience/loggable.rb
sapience-2.0.1 lib/sapience/loggable.rb
sapience-2.0.0 lib/sapience/loggable.rb
sapience-1.0.15 lib/sapience/loggable.rb
sapience-1.0.14 lib/sapience/loggable.rb
sapience-1.0.13 lib/sapience/loggable.rb
sapience-1.0.12 lib/sapience/loggable.rb
sapience-1.0.11 lib/sapience/loggable.rb
sapience-1.0.10 lib/sapience/loggable.rb