日志处理优化

yun-zuoyi
alwaysfrin 6 years ago
parent fc49ddeea5
commit da582b871d

@ -1134,4 +1134,51 @@ public class CommonEnumUtil {
// 数据未删除的静态常量
public static final int FALSE = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum LOG_DETAIL_SHOW_TYPE {
DEBUG(1, "DEBUG"),
OVER_TIME(2, "记录超时服务"),
ALL_METHOD(3, "所有服务"),
ALL_METHOD_PARAMETER(4, "所有服务和入参");
private int value;
private String description;
private LOG_DETAIL_SHOW_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
}

Loading…
Cancel
Save