Sha256: fd08f09e2238094cdda4e97a20281f25e83d7521cbece4a1cd7e351638a15e38
Contents?: true
Size: 488 Bytes
Versions: 7
Compression:
Stored size: 488 Bytes
Contents
module AbAdmin module Utils module Logger class ShortFormatter < ::Logger::Formatter def call(severity, time, progname, msg) "[#{time.strftime('%Y-%m-%dT%H:%M:%S')}] #{msg}\n" end end def self.for_file(filename) logfile = File.open(Rails.root.join('log', filename), 'a+') logfile.sync = true logger = ::Logger.new(logfile) logger.formatter = ShortFormatter.new logger end end end end
Version data entries
7 entries across 7 versions & 1 rubygems