Module: Mongoid::EncryptedFields::Logging
- Included in:
- Mongoid::EncryptedFields
- Defined in:
- lib/mongoid-encrypted-fields/logging.rb
Overview
Contains behavior for logging.
Instance Method Summary collapse
-
#default_logger ⇒ Logger
Get the default logger.
-
#logger ⇒ Logger
Get the logger.
-
#logger=(logger) ⇒ Logger
Set the logger.
-
#rails_logger ⇒ Logger
Get the rails logger.
Instance Method Details
#default_logger ⇒ Logger
Get the default logger.
41 42 43 44 45 |
# File 'lib/mongoid-encrypted-fields/logging.rb', line 41 def default_logger logger = Logger.new(STDOUT) logger.level = Logger::INFO logger end |
#logger ⇒ Logger
Get the logger.
16 17 18 19 |
# File 'lib/mongoid-encrypted-fields/logging.rb', line 16 def logger return @logger if defined?(@logger) @logger = rails_logger || default_logger end |
#logger=(logger) ⇒ Logger
Set the logger.
55 56 57 |
# File 'lib/mongoid-encrypted-fields/logging.rb', line 55 def logger=(logger) @logger = logger end |
#rails_logger ⇒ Logger
Get the rails logger.
29 30 31 |
# File 'lib/mongoid-encrypted-fields/logging.rb', line 29 def rails_logger defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger end |