1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| package com.kongshan.utils;
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogUtils { private static final Logger logger = LoggerFactory.getLogger(LogUtils.class);
public static void trace(String message) { if (logger.isTraceEnabled()) { logger.trace(message); } }
public static void debug(String message) { if (logger.isDebugEnabled()) { logger.debug(message); } }
public static void info(String message) { if (logger.isInfoEnabled()) { logger.info(message); } }
public static void warn(String message) { if (logger.isWarnEnabled()) { logger.warn(message); } }
public static void error(String message, Throwable throwable) { logger.error(message, throwable); } }
|