def write( event )
      str = event.instance_of?(::Logsly::Logging182::LogEvent) ?
            layout.format(event) : event.to_s
      return if str.empty?

      if @auto_flushing == 1
        canonical_write(str)
      else
        sync {
          str = str.force_encoding(encoding) if encoding and str.encoding != encoding
          @buffer << str
        }
        @periodic_flusher.signal if @periodic_flusher
        flush if @buffer.length >= @auto_flushing || immediate?(event)
      end

      self
    end
def write( event )
      str = event.instance_of?(::Logsly::Logging182::LogEvent) ?
            layout.format(event) : event.to_s
      return if str.empty?

      if @auto_flushing == 1
        canonical_write(str)
      else
        sync {
          str = str.force_encoding(encoding) if encoding and str.encoding != encoding
          @buffer << str
        }
        @periodic_flusher.signal if @periodic_flusher
        flush if @buffer.length >= @auto_flushing || immediate?(event)
      end

      self
    end
call-seq:
    write( event )

 Writes the given _event_ to the logging destination. The _event_ can
 be either a LogEvent or a String. If a LogEvent, then it will be
 formatted using the layout given to the appender when it was created.

 The _event_ will be formatted and then buffered until the
 "auto_flushing" level has been reached. At this time the canonical_write
 method will be used to log all events stored in the buffer.