def log(messages, event = :debug, level = event)
      return unless will_log?(level)
      @mutex.synchronize do
        Array(messages).each do |message|
          message = format_general(message)
          message = format_message(message, event)

          next if message.nil?
          @output.puts message.encode("locale", {:invalid => :replace, :undef => :replace})
        end
      end
    end
def log(messages, event = :debug, level = event)
      return unless will_log?(level)
      @mutex.synchronize do
        Array(messages).each do |message|
          message = format_general(message)
          message = format_message(message, event)

          next if message.nil?
          @output.puts message.encode("locale", {:invalid => :replace, :undef => :replace})
        end
      end
    end
Logs a message.

 @param [String, Array] messages The message(s) to log
 @param [:debug, :incoming, :outgoing, :info, :warn,
   :exception, :error, :fatal] event The kind of event that
   triggered the message
 @param [:debug, :info, :warn, :error, :fatal] level The level of the message
 @return [void]
 @version 2.0.0