def self.debug(message)
      if defined?(Rails) && Rails.respond_to?(:logger)
        Rails.logger.debug(message)
      elsif @logfile
        if @logfile.is_a?(String)