code: private void logShort(CharSequence message, boolean trim) throws IOException {
      int length = message.length();
      if (trim) {
        while (length > 0 && Character.isWhitespace(message.charAt(length - 1))) {
          length--;
        }
      }
  
      char [] chars = new char [length + 1];
      for (int i = 0; i < length; i++) {
        chars[i] = message.charAt(i);
      }
      chars[length] = '\n';
  
      output.write(chars);
    }
docs: Log a message line to the output.