docs: private static String format(String message, Object... args)
    {
      if(message == null) {
        return null;
      }
      if(message.isEmpty()) {
        return "";
      }
      if(args.length == 0) {
        return message;
      }
  
      for(int i = 0; i < args.length; i++) {
        // at this point args[i] could be null, condition silently ignored by next branching logic
        // and this is because all branch tests are null safe
        // anyway, if add new branch test takes care to be also null safe or test explicitly for args[i] == null
  
        if(args[i] instanceof Class) {
          args[i] = ((Class<?>)args[i]).getCanonicalName();
        }
        else if(args[i] instanceof Throwable) {
          String s = ((Throwable)args[i]).getMessage();
          if(s == null) {
            s = args[i].getClass().getCanonicalName();
          }
          args[i] = s;
        }
        else if(args[i] instanceof Thread) {
          Thread thread = (Thread)args[i];
          StringBuilder sb = new StringBuilder();
          sb.append(thread.getName());
          sb.append(':');
          sb.append(thread.getId());
          args[i] = sb.toString();
        }
        else if(args[i] instanceof File) {
          args[i] = ((File)args[i]).getAbsolutePath();
        }
        else if(isArrayLike(args[i])) {
          StringBuilder sb = new StringBuilder();
          sb.append('[');
          int index = 0;
          for(Object object : iterable(args[i])) {
            if(object == null) {
              continue;
            }
            String value = object instanceof String ? (String)object : object.toString();
            if(value.isEmpty()) {
              continue;
            }
            if(index++ > 0) {
              sb.append(',');
            }
            if(index == 4) {
              sb.append("...");
              break;
            }
            sb.append(object);
          }
          sb.append(']');
          args[i] = sb.toString();
        }
      }
  
      try {
        return String.format(message, args);
      }
      catch(Throwable unused) {
        // return unformatted message if format fails
        return message;
      }
    }