def canonical_write( str )
      return self if @io.nil?
      str = str.force_encoding(encoding) if encoding && str.encoding != encoding
      @io.write str
      self
    rescue StandardError => err
      handle_internal_error(err)
    end
def canonical_write( str )
      return self if @io.nil?
      str = str.force_encoding(encoding) if encoding && str.encoding != encoding
      @io.write str
      self
    rescue StandardError => err
      handle_internal_error(err)
    end
This method is called by the buffering code when messages need to be
 written to the logging destination.