Class: Rails::Crud::Tools::CrudLogger
- Inherits:
-
Object
- Object
- Rails::Crud::Tools::CrudLogger
- Includes:
- Singleton
- Defined in:
- lib/rails/crud/tools/crud_logger.rb
Overview
The CrudLogger class is responsible for logging CRUD operations to a file. It uses the Singleton pattern to ensure only one instance of the logger exists.
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ CrudLogger
constructor
A new instance of CrudLogger.
Constructor Details
#initialize ⇒ CrudLogger
Returns a new instance of CrudLogger.
16 17 18 |
# File 'lib/rails/crud/tools/crud_logger.rb', line 16 def initialize @logger = Logger.new("log/crud.log") end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
14 15 16 |
# File 'lib/rails/crud/tools/crud_logger.rb', line 14 def logger @logger end |
Class Method Details
.logger ⇒ Object
20 21 22 |
# File 'lib/rails/crud/tools/crud_logger.rb', line 20 def self.logger instance.logger end |