All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.taobao.middleware.logger.util.MessageUtil Maven / Gradle / Ivy

package com.taobao.middleware.logger.util;

public class MessageUtil {

    public static String formatMessage(String format, Object[] argArray) {
        FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
        return ft.getMessage();
    }

    public static String getMessage(String message) {
        return getMessage(null, message);
    }

    public static String getMessage(String context, String message) {
        return getMessage(context, null, message);
    }

    public static String getMessage(String context, String errorCode, String message) {
        if (context == null) {
            context = "";
        }

        if (errorCode == null) {
            errorCode = "";
        }
        return "[" + context + "] [] [" + errorCode + "] " + message;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy