IDEA中log的util工具类的规范使用

import org.slf4j.Logger;

public class LogUtil {
    public LogUtil() {

    }

    public static void info(Logger log, String format, Object... arguments) {
        if (log.isInfoEnabled()) {
            log.info(format, arguments);
        }
    }

    public static void debug(Logger log, String format, Object... arguments) {
        if (log.isDebugEnabled()) {
            log.debug(format, arguments);
        }
    }

    public static void tracre(Logger log, String format, Object... arguments) {
        if (log.isTraceEnabled()) {
            log.trace(format, arguments);
        }
    }

    public static void warn(Logger log, String format, Object... arguments) {
        if (log.isWarnEnabled()) {
            log.warn(format, arguments);
        }
    }

    public static void error(Logger log, String format, Object... arguments) {
        if (log.isErrorEnabled()) {
            log.error(format, arguments);
        }
    }


}

你可能感兴趣的:(util,log,java,开发语言)