docs: public static void warnWithException(Logger logger, String format, Object... arguments) {
      if (logger.isDebugEnabled()) {
        logger.warn(format, arguments);
      } else {
        Object last = arguments[arguments.length - 1];
        if (last instanceof Throwable) {
          Throwable t = (Throwable) last;
          arguments[arguments.length - 1] = t.getClass().getSimpleName() + ": " + t.getMessage();
          logger.warn(format + " ({})", arguments);
        } else {
          // Should only be called with an exception as last argument, but handle gracefully anyway
          logger.warn(format, arguments);
        }
      }
    }