@Override
      public void write(char[] cbuf, int off, int len) {
        while (len > 0 && Character.isWhitespace(cbuf[off + len - 1])) len--;
        if (len == 0) return;
        String s = new String(cbuf, off, len);
        if (error) {
          LOG.warn(s);
        }
        else {
          LOG.info(s);
        }
      }
@Override
      public void write(char[] cbuf, int off, int len)