使用slf4j的lombok注解做日志输出

master
lixin 6 years ago
parent a57bafd719
commit 65f1f537a1

@ -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;
}

Loading…
Cancel
Save