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
- #loga_context ⇒ Object private
-
#loga_loga ⇒ Object
private
Define the underlying logger to be used.
-
#logger ⇒ Object
private
A shorthand method to use in your classes.
Instance Method Details
#loga_context ⇒ Object
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_loga ⇒ Object
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.
Define the underlying logger to be used. Overwrite this to use a specific logger instance
24 25 26 27 28 29 30 |
# File 'lib/mr_loga_loga/instance_methods.rb', line 24 def loga_loga @loga_loga ||= if defined?(Rails.logger) Rails.logger else MrLogaLoga.configuration.logger end end |
#logger ⇒ Object
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.
A shorthand method to use in your classes
15 16 17 18 19 20 21 |
# File 'lib/mr_loga_loga/instance_methods.rb', line 15 def logger if loga_loga.is_a?(MrLogaLoga::Logger) loga_loga.context { loga_context } else loga_loga end end |