private String formatArgs(String format, Object... args) {
        if (format != null) {
            return String.format(format, args);
        } else {
            StringBuilder sb = new StringBuilder();
            for (int i = 0, N = args.length; i < N; i++) {
                if (i != 0) {
                    sb.append(", ");
                }
                sb.append(args[i]);
            }
            return sb.toString();
        }
    }
Format a string with arguments.

@param format the format string, null if just to concat the arguments
@param args   the arguments
@return the formatted string
android/android_framework/base/src/main/java/com/elvishew/xlog/Logger.java