def add(level, message = nil, progname = nil, &block)
      progname ||= default_options['facility']
      message ||= block.call unless block.nil?

      if message.nil?
        message = progname
        progname = default_options['facility']
      end

      message_hash = { 'facility' => progname }

      if message.is_a?(Hash)
        message.each do |key, value|
          message_hash[key.to_s] = value.to_s
        end
      else
        message_hash['short_message'] = message.to_s
      end

      if message.is_a?(Exception)
        message_hash.merge!(self.class.extract_hash_from_exception(message))
      end

      if message_hash.key?('short_message') && !message_hash['short_message'].empty?
        notify_with_level(level, message_hash)
      end
    end
def add(level, message = nil, progname = nil, &block)
      progname ||= default_options['facility']
      message ||= block.call unless block.nil?

      if message.nil?
        message = progname
        progname = default_options['facility']
      end

      message_hash = { 'facility' => progname }

      if message.is_a?(Hash)
        message.each do |key, value|
          message_hash[key.to_s] = value.to_s
        end
      else
        message_hash['short_message'] = message.to_s
      end

      if message.is_a?(Exception)
        message_hash.merge!(self.class.extract_hash_from_exception(message))
      end

      if message_hash.key?('short_message') && !message_hash['short_message'].empty?
        notify_with_level(level, message_hash)
      end
    end
Use it like Logger#add... or better not to use at all.