require 'logger' module SqsPoller module Logger class << self @logger_file = nil @logger = nil @log_level def get_new_logger (prog_name = nil, log_level = nil) if @logger_file.nil? logger = ::Logger.new(STDOUT) else logger = ::Logger.new(@logger_file) end @log_level = @log_level || ::Logger::ERROR logger.level = log_level || @log_level logger.progname = prog_name logger end def set_log_level (log_level) @log_level = log_level end def set_logger_file (logger_file) @logger_file = logger_file end def get_logger if @logger.nil? @logger = get_new_logger end @logger end end end end