Sha256: ade5f6e8635c184319802255a3f3c4c268f677a5197e215cb9f9ba0bd0efab4a

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

module MrLogaLoga
  # == Description
  #
  # Instance methods to be attached when including the main module.
  #
  # @api private
  module InstanceMethods
    def loga_context
      { class_name: self.class.name }
    end

    def logger
      MrLogaLoga::LoggerProxy.new(loga_loga, -> { loga_context })
    end

    def loga_loga
      @loga_loga ||= if defined?(Rails.logger)
                       Rails.logger
                     else
                       MrLogaLoga.configuration.logger
                     end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mr_loga_loga-0.1.1 lib/mr_loga_loga/instance_methods.rb