Class: Rabarber::Audit::Logger
- Inherits:
-
Object
- Object
- Rabarber::Audit::Logger
- Includes:
- Singleton
- Defined in:
- lib/rabarber/audit/logger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
12 13 14 |
# File 'lib/rabarber/audit/logger.rb', line 12 def initialize @logger = ::Logger.new(Rails.root.join("log/rabarber_audit.log")) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/rabarber/audit/logger.rb', line 10 def logger @logger end |
Class Method Details
.log(log_level, message) ⇒ Object
16 17 18 19 20 |
# File 'lib/rabarber/audit/logger.rb', line 16 def self.log(log_level, ) return unless Rabarber::Configuration.instance.audit_trail_enabled instance.logger.public_send(log_level, ) end |