diff --git a/src/main/java/com/emr/util/DateUtils.java b/src/main/java/com/emr/util/DateUtils.java index 3660c46..dc4d4b7 100644 --- a/src/main/java/com/emr/util/DateUtils.java +++ b/src/main/java/com/emr/util/DateUtils.java @@ -6,15 +6,15 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; -import org.apache.log4j.Logger; +import lombok.extern.slf4j.Slf4j; /** * 时间处理类 * @author Mr Du * */ +@Slf4j public class DateUtils { - private static Logger LOGGER = Logger.getLogger(DateUtils.class); /** * Format String : yyyy-MM-dd HH:mm:ss @@ -85,7 +85,7 @@ public class DateUtils { try { ret = sdf.format(date); } catch (Exception ex) { - LOGGER.error(ex, ex); + log.error("日期格式转换失败", ex); } return ret; } @@ -129,7 +129,7 @@ public class DateUtils { String integerDate = stringDate.replaceAll("/", "").replaceAll("年", "").replaceAll("月", "").replaceAll("日", "").replaceAll(":", ":"); ret = sdf.parse(integerDate); } catch (Exception ex) { - LOGGER.error(ex, ex); + log.error("日期格式转换失败", ex); } return ret; }