Class: Rabarber::Audit::Logger

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/rabarber/audit/logger.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogger

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

#loggerObject (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, message)
  return unless Rabarber::Configuration.instance.audit_trail_enabled

  instance.logger.public_send(log_level, message)
end