Module: MrLogaLoga::InstanceMethods Private

Defined in:
lib/mr_loga_loga/instance_methods.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Description

Instance methods to be attached when including the main module.

Instance Method Summary collapse

Instance Method Details

#loga_contextObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
# File 'lib/mr_loga_loga/instance_methods.rb', line 10

def loga_context
  { class_name: self.class.name }
end

#loga_logaObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
26
27
28
# File 'lib/mr_loga_loga/instance_methods.rb', line 22

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

#loggerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
20
# File 'lib/mr_loga_loga/instance_methods.rb', line 14

def logger
  if loga_loga.is_a?(MrLogaLoga::Logger)
    MrLogaLoga::LoggerProxy.new(loga_loga, -> { loga_context })
  else
    loga_loga
  end
end