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); } } }
文章来源地址https://www.toymoban.com/news/detail-671687.html
文章来源:https://www.toymoban.com/news/detail-671687.html
到了这里,关于IDEA中log的util工具类的规范使用的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!