Module: SupplejackApi::Support::StatusLogger

Defined in:
app/models/supplejack_api/support/status_logger.rb

Class Method Summary collapse

Class Method Details

.loggerObject


12
13
14
15
16
17
18
19
20
# File 'app/models/supplejack_api/support/status_logger.rb', line 12

def self.logger
  logfile = File.open("#{Rails.root}/log/status.log", 'a')
  logfile.sync = true
  @logger ||= Logger.new(logfile)
  @logger.formatter = proc do |_severity, datetime, _progname, msg|
    "#{datetime.to_formatted_s(:db)} #{msg}\n"
  end
  @logger
end