top.wboost.common.log.entity.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(375)

本文整理了Java中top.wboost.common.log.entity.Logger.warn()方法的一些代码示例,展示了Logger.warn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()方法的具体详情如下:
包路径:top.wboost.common.log.entity.Logger
类名称:Logger
方法名:warn

Logger.warn介绍

暂无

代码示例

代码示例来源:origin: top.wboost/common-utils-web

public static Object getBean(String beanId) {
  try {
    Object bean = applicationContext.getBean(beanId);
    return bean;
  } catch (Exception e) {
    log.warn("mvc spring bean :{} cant find.", beanId);
    return null;
  }
}

代码示例来源:origin: top.wboost/common-utils-web

public static Object getBean(String beanId) {
  try {
    return applicationContext.getBean(beanId);
  } catch (Exception e) {
    log.warn("spring bean :{} cant find.", beanId);
    return null;
  }
}

代码示例来源:origin: top.wboost/common-utils-web

public static <T> T getBean(Class<T> clazz) {
  try {
    return applicationContext.getBean(clazz);
  } catch (Exception e) {
    log.warn("spring bean :{} cant find.", clazz.getName());
    return null;
  }
}

代码示例来源:origin: top.wboost/common-utils-web

public static <T> T getBean(Class<T> clazz) {
  try {
    return applicationContext.getBean(clazz);
  } catch (Exception e) {
    log.warn("mvc spring bean :{} cant find.", clazz.getName());
    return null;
  }
}

代码示例来源:origin: top.wboost/common-context

protected Collection<BeanDefinition> getFactoryBeans() {
  Collection<BeanDefinition> find = getXmlRegisterConfiguration().getCandidates();
  Set<BeanDefinition> result = new HashSet<BeanDefinition>();
  ClassLoader classLoader = org.springframework.util.ClassUtils.getDefaultClassLoader();
  for (BeanDefinition bean : find) {
    String interfaceName = bean.getBeanClassName();
    try {
      BeanDefinitionBuilder builder = BeanDefinitionBuilder
          .rootBeanDefinition(ProxyBeanFactoryBean.class.getName())
          .addPropertyValue("repositoryInterface",
              org.springframework.util.ClassUtils.forName(interfaceName, classLoader));
      String config = getXmlRegisterConfiguration().getAttribute(CONFIG);
      builder.addPropertyValue("config", config);
      result.add(builder.getBeanDefinition());
    } catch (ClassNotFoundException e) {
      log.warn(String.format(CLASS_LOADING_ERROR, interfaceName, classLoader), e);
    } catch (LinkageError e) {
      log.warn(String.format(CLASS_LOADING_ERROR, interfaceName, classLoader), e);
    }
  }
  return result;
}

代码示例来源:origin: top.wboost/common-web

@Override
public boolean checkParameter(Annotation parameterConfig, Object arg) {
  if (parameterConfig.annotationType().isAnnotationPresent(ParameterConfig.class)) {
    ParameterConfigChecker checker = parameterConfigMap.get(parameterConfig.annotationType());
    if (checker == null) {
      throw new BusinessException();
    }
    return checker.check(arg, parameterConfig, "");
  }
  if (log.isWarnEnabled()) {
    log.warn("Annotation {} is not a parameterConfig annotation", parameterConfig);
  }
  return false;
}

代码示例来源:origin: top.wboost/common-web

protected void autowired(BaseJpaServiceImpl service) {
  Class<?> clazz = ClassUtils.getUserClass(service);
  if (clazz.getSimpleName().indexOf("ServiceImpl") == -1) {
    throw new SystemException("服务层类名必须以ServiceImpl结尾");
  }
  String className = clazz.getSimpleName().substring(0, clazz.getSimpleName().indexOf("ServiceImpl"));
  className = Character.toLowerCase(className.charAt(0)) + className.substring(1, className.length());
  String defaultBeanName = className + "Repository";
  Object repository = SpringBeanUtil.getBean(defaultBeanName);
  if (repository == null) {
    log.warn("cant find bean:" + defaultBeanName + ",please check");
    return;
  }
  if (repository instanceof BaseRepository) {
    BaseRepository<?, ?> findRepository = (BaseRepository<?, ?>) repository;
    log.info("auto config bean: " + defaultBeanName + " to service:" + clazz.getName());
    service.setRepository(findRepository);
  } else {
    throw new BeanNotFindException(defaultBeanName, BaseRepository.class);
  }
}

代码示例来源:origin: top.wboost/common-web

public static boolean check(ResponseEntity<String> response) {
  if (response == null || response.getStatusCode() != HttpStatus.OK)
    return false;
  String body = response.getBody();
  if (!StringUtil.notEmpty(body)) {
    return false;
  }
  try {
    JSONObject jobj = JSONObject.parseObject(body);
    int status = jobj.getInteger("status");
    if (status == ResultStatus.SUCCESS.getValue()) {
      return true;
    }
  } catch (Exception e) {
    if (log.isWarnEnabled()) {
      log.warn("body:{},exception is : {}", body, e.getLocalizedMessage());
    }
  }
  return false;
}

代码示例来源:origin: top.wboost/common-web

protected void autowired(BaseJpaServiceImpl service) {
  Class<?> clazz = ClassUtils.getUserClass(service);
  Object repository = null;
  Class<?> genericInterfaces = ReflectUtil.getGenericInterfaces(clazz, 1);
  repository = SpringBeanUtil.getBean(genericInterfaces);
  String defaultBeanName = null;
  if (repository == null) {
    if (clazz.getSimpleName().indexOf("ServiceImpl") == -1) {
      throw new SystemException("服务层类名必须以ServiceImpl结尾");
    }
    String className = clazz.getSimpleName().substring(0, clazz.getSimpleName().indexOf("ServiceImpl"));
    className = Character.toLowerCase(className.charAt(0)) + className.substring(1, className.length());
    defaultBeanName = className + "Repository";
    repository = SpringBeanUtil.getBean(defaultBeanName);
    if (repository == null) {
      log.warn("cant find bean:" + defaultBeanName + ",please check");
      return;
    }
  } else {
    defaultBeanName = genericInterfaces.getName();
  }
  if (repository != null && repository instanceof BaseRepository) {
    BaseRepository<?, ?> findRepository = (BaseRepository<?, ?>) repository;
    log.info("auto config bean: " + defaultBeanName + " to service:" + clazz.getName());
    service.setRepository(findRepository);
  } else {
    throw new BeanNotFindException(defaultBeanName, BaseRepository.class);
  }
}

代码示例来源:origin: top.wboost/common-web

@Override
public T update(ID id, T t) {
  T find = getBaseRepository().getOne(id);
  if (find == null) {
    return find;
  }
  Map<String, Object> fieldMap = ConvertUtil.beanConvertToMap(t);
  fieldMap.forEach((fieldName, value) -> {
    if (value == null) {
      return;
    }
    Method writeMethod = ReflectUtil.getWriteMethod(t.getClass(), fieldName);
    if (writeMethod != null) {
      try {
        writeMethod.invoke(find, value);
      } catch (Exception e) {
        log.warn("write field : " + fieldName + " error,cause by : " + e);
      }
    }
  });
  return getRepository().save(find);
}

代码示例来源:origin: top.wboost/common-web

@Override
public T update(String id, T t) {
  T find = getBaseRepository().getOne(id);
  if (find == null) {
    return find;
  }
  Map<String, Object> fieldMap = ConvertUtil.beanConvertToMap(t);
  fieldMap.forEach((fieldName, value) -> {
    if (value == null) {
      return;
    }
    Method writeMethod = ReflectUtil.getWriteMethod(t.getClass(), fieldName);
    if (writeMethod != null) {
      try {
        writeMethod.invoke(find, value);
      } catch (Exception e) {
        log.warn("write field : " + fieldName + " error,cause by : " + e);
      }
    }
  });
  return getRepository().save(find);
}

代码示例来源:origin: top.wboost/common-utils-web

log.warn(e.getLocalizedMessage());

代码示例来源:origin: top.wboost/common-web

} catch (SystemCodeException throwable) {
  MethodLog methodLog = getThrowableLog(proceedingJoinPoint, throwable);
  log.warn("SystemCodeException : {}", methodLog);
  if (throwable.isWriteLog()) {
    logManager.sendLog(methodLog);
} catch (AbstractBaseCodeException throwable) {
  MethodLog methodLog = getThrowableLog(proceedingJoinPoint, throwable);
  log.warn("BaseCodeException : {}", methodLog);
  if (throwable.isWriteLog()) {
    logManager.sendLog(methodLog);
} catch (BaseException throwable) {
  MethodLog methodLog = getThrowableLog(proceedingJoinPoint, throwable);
  log.warn("BaseException : {}", methodLog);
  if (throwable.isWriteLog()) {
    logManager.sendLog(methodLog);

相关文章