使用Slf4j注解打印日志
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
package com.genersoft.iot.vmp.utils;
|
||||
|
||||
import com.genersoft.iot.vmp.common.CivilCodePo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Slf4j
|
||||
public enum CivilCodeUtil {
|
||||
|
||||
INSTANCE;
|
||||
private final static Logger logger = LoggerFactory.getLogger(CivilCodeUtil.class);
|
||||
|
||||
// 用与消息的缓存
|
||||
private final Map<String, CivilCodePo> civilCodeMap = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.genersoft.iot.vmp.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Slf4j
|
||||
public class GpsUtil {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(GpsUtil.class);
|
||||
|
||||
public static BaiduPoint Wgs84ToBd09(String xx, String yy) {
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.genersoft.iot.vmp.utils;
|
||||
|
||||
import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import oshi.SystemInfo;
|
||||
import oshi.hardware.*;
|
||||
import oshi.hardware.CentralProcessor;
|
||||
import oshi.hardware.GlobalMemory;
|
||||
import oshi.hardware.HardwareAbstractionLayer;
|
||||
import oshi.hardware.NetworkIF;
|
||||
import oshi.software.os.OperatingSystem;
|
||||
import oshi.util.FormatUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -22,10 +20,9 @@ import java.util.concurrent.TimeUnit;
|
||||
* 版权声明:本文为xiaozhangnomoney原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明
|
||||
* 原文出处链接:https://blog.csdn.net/xiaozhangnomoney/article/details/107769147
|
||||
*/
|
||||
@Slf4j
|
||||
public class SystemInfoUtils {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(SystemInfoUtils.class);
|
||||
|
||||
/**
|
||||
* 获取cpu信息
|
||||
* @return
|
||||
@@ -78,7 +75,7 @@ public class SystemInfoUtils {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("[线程休眠失败] : {}", e.getMessage());
|
||||
log.error("[线程休眠失败] : {}", e.getMessage());
|
||||
}
|
||||
List<NetworkIF> afterNetworkIFs = hal.getNetworkIFs();
|
||||
NetworkIF afterNet = afterNetworkIFs.get(afterNetworkIFs.size() - 1);
|
||||
|
||||
@@ -4,9 +4,8 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -17,9 +16,9 @@ import java.util.Objects;
|
||||
* @version 1.0
|
||||
* @date 2022/3/11 10:17
|
||||
*/
|
||||
@Slf4j
|
||||
public class UJson {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UJson.class);
|
||||
public static final ObjectMapper JSON_MAPPER = new ObjectMapper();
|
||||
|
||||
static {
|
||||
@@ -39,7 +38,7 @@ public class UJson {
|
||||
try {
|
||||
this.node = JSON_MAPPER.readValue(json, ObjectNode.class);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(), e);
|
||||
this.node = JSON_MAPPER.createObjectNode();
|
||||
}
|
||||
}
|
||||
@@ -90,7 +89,7 @@ public class UJson {
|
||||
try {
|
||||
return JSON_MAPPER.readValue(json, clazz);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +98,7 @@ public class UJson {
|
||||
try{
|
||||
return JSON_MAPPER.writeValueAsString(object);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(), e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user