public static String formatBesuLogMessage(final String input) {
    final StringBuilder builder = new StringBuilder(input.length());
    char prevChar = 0;

    for (int i = 0; i < input.length(); i++) {
      final char c = input.charAt(i);

      if (c == 0x0A) {
        if (prevChar == 0x0D) {
          builder.append(prevChar);
        }
        builder.append(c);
      } else if (c == 0x09 || !Character.isISOControl(c)) {
        builder.append(c);
      }

      prevChar = c;
    }

    return builder.toString();
  }
Format Besu log message.

@param input The log message
@return The formatted log message
util/src/main/java/org/hyperledger/besu/util/log4j/plugin/BesuLogMessageConverter.java