优化代码
This commit is contained in:
+4
-4
@@ -9,12 +9,12 @@ import lombok.extern.slf4j.Slf4j;
|
||||
*/
|
||||
@Slf4j
|
||||
public class PointUtil {
|
||||
private static final String MSG_PATTERN = "{}|{}|{}";
|
||||
|
||||
private PointUtil() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
|
||||
public static final String SPLIT = "|";
|
||||
|
||||
/**
|
||||
* 格式为:{时间}|{来源}|{对象id}|{类型}|{对象属性(以&分割)}
|
||||
* 例子1:2016-07-27 23:37:23|business-center|1|user-login|ip=xxx.xxx.xx&userName=张三&userType=后台管理员
|
||||
@@ -25,10 +25,10 @@ public class PointUtil {
|
||||
* @param message 对象属性
|
||||
*/
|
||||
public static void info(String id, String type, String message) {
|
||||
log.info(id + SPLIT + type + SPLIT + message);
|
||||
log.info(MSG_PATTERN, id, type, message);
|
||||
}
|
||||
|
||||
public static void debug(String id, String type, String message) {
|
||||
log.debug(id + SPLIT + type + SPLIT + message);
|
||||
log.debug(MSG_PATTERN, id, type, message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user