| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.lang.reflect.Array; |
| | |
| | | } |
| | | |
| | | public static void info(String format, Object... arguments) { |
| | | if (format.contains("[WCS Debug]")) { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if(redisUtil != null) { |
| | | boolean show = true; |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj != null) { |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | if (systemConfigMap.get("wcsDebugShowLog") != null) { |
| | | show = systemConfigMap.get("wcsDebugShowLog").equals("true"); |
| | | } |
| | | } |
| | | |
| | | if (!show) { |
| | | return; |
| | | } |
| | | } |
| | | log.info(format, arguments); |
| | | offer(NewsLevel.INFO, format, arguments); |
| | | return; |
| | | } |
| | | |
| | | RedisUtil redisUtil = null; |
| | | try { |
| | | redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if(redisUtil != null) { |
| | | Object object = redisUtil.get(RedisKeyType.LOG_LIMIT.key + format); |
| | | if (object != null) { |
| | | return; |
| | | } |
| | | redisUtil.set(RedisKeyType.LOG_LIMIT.key + format, "lock", 3); |
| | | } |
| | | }catch (Exception e) {} |
| | | |
| | | log.info(format, arguments); |
| | | offer(NewsLevel.INFO, format, arguments); |
| | | } |
| | | |
| | | public static void warn(String format, Object... arguments) { |
| | | if (format.contains("[WCS Debug]")) { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if(redisUtil != null) { |
| | | boolean show = true; |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj != null) { |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | if (systemConfigMap.get("wcsDebugShowLog") != null) { |
| | | show = systemConfigMap.get("wcsDebugShowLog").equals("true"); |
| | | } |
| | | } |
| | | |
| | | if (!show) { |
| | | return; |
| | | } |
| | | } |
| | | log.warn(format, arguments); |
| | | offer(NewsLevel.WARN, format, arguments); |
| | | return; |
| | | } |
| | | |
| | | RedisUtil redisUtil = null; |
| | | try { |
| | | redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if(redisUtil != null) { |
| | | Object object = redisUtil.get(RedisKeyType.LOG_LIMIT.key + format); |
| | | if (object != null) { |
| | | return; |
| | | } |
| | | redisUtil.set(RedisKeyType.LOG_LIMIT.key + format, "lock", 3); |
| | | } |
| | | }catch (Exception e) {} |
| | | |
| | | log.warn(format, arguments); |
| | | offer(NewsLevel.WARN, format, arguments); |
| | | } |
| | | |
| | | public static void error(String format, Object... arguments) { |
| | | if (format.contains("[WCS Debug]")) { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if(redisUtil != null) { |
| | | boolean show = true; |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj != null) { |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | if (systemConfigMap.get("wcsDebugShowLog") != null) { |
| | | show = systemConfigMap.get("wcsDebugShowLog").equals("true"); |
| | | } |
| | | } |
| | | |
| | | if (!show) { |
| | | return; |
| | | } |
| | | } |
| | | log.error(format, arguments); |
| | | offer(NewsLevel.ERROR, format, arguments); |
| | | return; |
| | | } |
| | | |
| | | RedisUtil redisUtil = null; |
| | | try { |
| | | redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if(redisUtil != null) { |
| | | Object object = redisUtil.get(RedisKeyType.LOG_LIMIT.key + format); |
| | | if (object != null) { |
| | | return; |
| | | } |
| | | redisUtil.set(RedisKeyType.LOG_LIMIT.key + format, "lock", 3); |
| | | } |
| | | }catch (Exception e) {} |
| | | |
| | | log.error(format, arguments); |
| | | offer(NewsLevel.ERROR, format, arguments); |
| | | } |