Sha256: cd5e368921e08f08a38aa1fa7ffd80f2950d7aced667b3d95f281537baac5304
Contents?: true
Size: 817 Bytes
Versions: 6
Compression:
Stored size: 817 Bytes
Contents
module Rack module SimpleAuth # class Logger # This class receives a logpath, env and message and # prints the message to the specified logpath for the proper env file (eg.: /path/to/file/test_error.log for test env) module Logger # Create Logfile # # @param [String] logpath [path to logfile] # @param [TrueClass|FalseClass] verbose [if true print to stdout] # @param [String] msg [Message defined by each Authorization class] # def self.log(logpath, verbose, env, msg) if logpath system("mkdir #{logpath}") unless Dir.exist?("#{logpath}") open("#{logpath}/#{env}_error.log", 'a') do |f| f << "#{msg}\n" end end puts msg if verbose end end # Logger end # SimpleAuth end # Rack
Version data entries
6 entries across 6 versions & 1 rubygems