package cn.exploring.engine.server.db.util;

import org.apache.logging.log4j.message.ParameterizedMessage;

import java.util.Objects;

public class StrUtil {

    public static String format(String messagePattern, Object... arguments) {
        if (Objects.nonNull(arguments) && arguments.length == 1 && Objects.nonNull(arguments[0]) && arguments[0].getClass().isArray()) {
            arguments = (Object[]) arguments[0];
        }

        return ParameterizedMessage.format(messagePattern, arguments);
    }
}
