Module: Moped::Logging
- Included in:
- Moped
- Defined in:
- lib/moped/logging.rb
Overview
Contains behaviour 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.
39 40 41 42 43 |
# File 'lib/moped/logging.rb', line 39 def default_logger logger = Logger.new(STDOUT) logger.level = Logger::INFO logger end |
#logger ⇒ Logger
Get the logger.
14 15 16 17 |
# File 'lib/moped/logging.rb', line 14 def logger return @logger if defined?(@logger) @logger = rails_logger || default_logger end |
#logger=(logger) ⇒ Logger
Set the logger.
53 54 55 |
# File 'lib/moped/logging.rb', line 53 def logger=(logger) @logger = logger end |
#rails_logger ⇒ Logger
Get the rails logger.
27 28 29 |
# File 'lib/moped/logging.rb', line 27 def rails_logger defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger end |