Class: SolidusImportProducts::Logger
- Inherits:
-
Object
- Object
- SolidusImportProducts::Logger
- Includes:
- Singleton
- Defined in:
- lib/solidus_import_products/logger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #log(message, severity = :info) ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
7 8 9 |
# File 'lib/solidus_import_products/logger.rb', line 7 def initialize self.logger = ActiveSupport::Logger.new(Spree::ProductImport.settings[:log_to]) end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/solidus_import_products/logger.rb', line 5 def logger @logger end |
Instance Method Details
#log(message, severity = :info) ⇒ Object
11 12 13 |
# File 'lib/solidus_import_products/logger.rb', line 11 def log(, severity = :info) logger.send severity, "[#{Time.now.to_s(:db)}] [#{severity.to_s.capitalize}] #{}\n" end |