org.tinygroup.logger.Logger.error()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(244)

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

Logger.error介绍

暂无

代码示例

代码示例来源:origin: org.tinygroup/org.tinygroup.pc

  1. public synchronized void setObjectStorage(ObjectStorage objectStorage) {
  2. this.objectStorage = objectStorage;
  3. try {
  4. List<Work> works = objectStorage.loadObjects("Work");
  5. this.workList.addAll(works);
  6. } catch (Exception e) {
  7. LOGGER.error(e);
  8. }
  9. }

代码示例来源:origin: org.tinygroup/org.tinygroup.sequence

  1. LOGGER.error("ERROR ## init the multiple-Sequence-Map failed!", e);

代码示例来源:origin: org.tinygroup/org.tinygroup.sequence

  1. private int select(int[] areaEnds) {
  2. int sum = areaEnds[areaEnds.length - 1];
  3. if (sum == 0) {
  4. logger.error("ERROR ## areaEnds: " + intArray2String(areaEnds));
  5. return -1;
  6. }
  7. int rand = random.nextInt(sum);
  8. for (int i = 0; i < areaEnds.length; i++) {
  9. if (rand < areaEnds[i]) {
  10. return i;
  11. }
  12. }
  13. return -1;
  14. }

代码示例来源:origin: org.tinygroup/org.tinygroup.service

  1. /**
  2. * 从AnnotationClassAction接入,新增注解服务
  3. *
  4. * @param clazz
  5. * @param annotation
  6. * @param serviceRegistry
  7. */
  8. public void loadService(Class<?> clazz, Annotation annotation,
  9. ServiceRegistry serviceRegistry) {
  10. String className = clazz.getName();
  11. LOGGER.logMessage(LogLevel.INFO, "从{}中查找ServiceAnnotation", className);
  12. try {
  13. registerServices(clazz, annotation, serviceRegistry);
  14. } catch (Exception e) {
  15. LOGGER.error("service.loadServiceException", e, className);
  16. }
  17. }

代码示例来源:origin: org.tinygroup/service

  1. /**
  2. *
  3. * 从AnnotationClassAction接入,新增注解服务
  4. *
  5. * @param clazz
  6. * @param annotation
  7. * @param serviceRegistry
  8. */
  9. public void loadService(Class<?> clazz, Annotation annotation,
  10. ServiceRegistry serviceRegistry) {
  11. String className = clazz.getName();
  12. logger.logMessage(LogLevel.INFO, "从{}中查找ServiceAnnotation", className);
  13. try {
  14. registerServices(clazz, annotation, serviceRegistry);
  15. } catch (Exception e) {
  16. logger.error("service.loadServiceException", e, className);
  17. }
  18. }

代码示例来源:origin: org.tinygroup/tinymenuframe-controller

  1. /**
  2. *
  3. * @param request
  4. * @param response
  5. * @param handler
  6. * @param ex
  7. * @return
  8. */
  9. @ResponseBody
  10. public ModelAndView resolveException(HttpServletRequest request,
  11. HttpServletResponse response, Object handler, Exception ex) {
  12. logger.error(ex);
  13. String message = null;
  14. ModelAndView model = new ModelAndView();
  15. //判断是否ajax
  16. if((request.getHeader("X-Requested-With") != null && "XMLHttpRequest".equals( request.getHeader("X-Requested-With").toString()))){
  17. MappingJackson2JsonView view = new MappingJackson2JsonView();
  18. Map attributes = new HashMap();
  19. attributes.put("status", Boolean.TRUE);
  20. attributes.put("info", message);
  21. view.setAttributesMap(attributes);
  22. model.setView(view);
  23. }else{
  24. model.setViewName("/syserror/error");
  25. }
  26. return model;
  27. }

代码示例来源:origin: org.tinygroup/bizframe2-controller

  1. HttpServletResponse response, Object handler, Exception ex) {
  2. logger.error(ex);
  3. String message = "出现异常!";
  4. ModelAndView model = new ModelAndView();

代码示例来源:origin: org.tinygroup/org.tinygroup.fileresolver

  1. /**
  2. * 转换XML为Xstream对象
  3. *
  4. * @param <T>
  5. * @param stream
  6. * @param fileObject
  7. * @return
  8. */
  9. @SuppressWarnings("unchecked")
  10. protected <T> T convertFromXml(XStream stream, FileObject fileObject) {
  11. InputStream inputStream = null;
  12. try {
  13. inputStream = fileObject.getInputStream();
  14. return (T) stream.fromXML(inputStream);
  15. } catch (Exception e) {
  16. throw new RuntimeException("转换XML文件成Xstream对象发生异常,路径:" + fileObject.getAbsolutePath(), e);
  17. } finally {
  18. if (inputStream != null) {
  19. try {
  20. inputStream.close();
  21. } catch (Exception e) {
  22. LOGGER.error("关闭文件流时出错,文件路径:{}", e, fileObject.getAbsolutePath());
  23. }
  24. }
  25. }
  26. }
  27. }

代码示例来源:origin: org.tinygroup/org.tinygroup.imda

  1. private void forward(WebContext context, ModelRequestInfo modelRequestInfo,
  2. String path) {
  3. String[] paths = path.split("[?]");
  4. HttpServletRequest request = context.getRequest();
  5. if (modelRequestInfo.pagelet && paths[0].endsWith(".page")) {
  6. paths[0] += "let";
  7. }
  8. String p = paths[0];
  9. if (paths.length == 2) {
  10. p = p + "?" + paths[1];
  11. }
  12. VelocityHelperImpl velocityHelper = SpringUtil
  13. .getBean("velocityHelper");
  14. StringWriter out = new StringWriter();
  15. velocityHelper.evaluteString(context, out, p);
  16. String forwardPath = out.toString();
  17. logger.logMessage(LogLevel.INFO, "重新转向到地址:{}", forwardPath);
  18. try {
  19. request.getRequestDispatcher(forwardPath).forward(request,
  20. context.getResponse());
  21. } catch (Exception e1) {
  22. logger.error(e1);
  23. }
  24. }

代码示例来源:origin: org.tinygroup/org.tinygroup.pc

  1. public synchronized void add(Work work) throws RemoteException {
  2. if (work.isNeedSerialize()) {
  3. if (objectStorage == null) {
  4. throw new PCRuntimeException("没有对象仓库对象实例存在!");
  5. }
  6. try {
  7. objectStorage.saveObject(work, "Work");
  8. } catch (IOException e) {
  9. LOGGER.error(e);
  10. throw new PCRuntimeException(String.format("序列化Work:%s %s时出现异常", work.getType(), work.getId()), e);
  11. }
  12. }
  13. workList.add(work);
  14. }

代码示例来源:origin: org.tinygroup/service

  1. /**
  2. * 载入服务
  3. */
  4. public void loadService(ServiceRegistry serviceRegistry)
  5. throws ServiceLoadException {
  6. List<String> classNames = getClassNames();// 这个由子类提供
  7. for (String className : classNames) {
  8. try {
  9. logger.logMessage(LogLevel.INFO,
  10. "从{className}中查找ServiceAnnotation", className);
  11. Class<?> clazz = Class.forName(className);
  12. Annotation annotation = clazz
  13. .getAnnotation(ServiceComponent.class);
  14. if (annotation != null) {
  15. registerServices(clazz, annotation, serviceRegistry);
  16. } else {
  17. logger.logMessage(LogLevel.INFO,
  18. "{className}中无ServiceAnnotation", className);
  19. }
  20. logger.logMessage(LogLevel.INFO,
  21. "从{className}中查找ServiceAnnotation完成", className);
  22. } catch (Exception e) {
  23. logger.error("service.loadServiceException", e, className);
  24. }
  25. }
  26. }

代码示例来源:origin: org.tinygroup/org.tinygroup.service

  1. /**
  2. * 载入服务
  3. */
  4. public void loadService(ServiceRegistry serviceRegistry, ClassLoader classLoader)
  5. throws ServiceLoadException {
  6. List<String> classNames = getClassNames();// 这个由子类提供
  7. for (String className : classNames) {
  8. try {
  9. LOGGER.logMessage(LogLevel.INFO,
  10. "从{className}中查找ServiceAnnotation", className);
  11. Class<?> clazz = classLoader.loadClass(className);
  12. Annotation annotation = clazz
  13. .getAnnotation(ServiceComponent.class);
  14. if (annotation != null) {
  15. registerServices(clazz, annotation, serviceRegistry);
  16. } else {
  17. LOGGER.logMessage(LogLevel.INFO,
  18. "{className}中无ServiceAnnotation", className);
  19. }
  20. LOGGER.logMessage(LogLevel.INFO,
  21. "从{className}中查找ServiceAnnotation完成", className);
  22. } catch (Exception e) {
  23. LOGGER.error("service.loadServiceException", e, className);
  24. }
  25. }
  26. }

代码示例来源:origin: org.tinygroup/org.tinygroup.metadata

  1. public void addBusinessTypes(BusinessTypes businessTypes) {
  2. if (businessTypes != null && businessTypes.getBusinessTypeList() != null) {
  3. for (BusinessType type : businessTypes.getBusinessTypeList()) {
  4. if (businessTypeMap.containsKey(type.getId())) {
  5. if (ConfigUtil.isCheckStrict()) {
  6. //重复id
  7. throw new MetadataRuntimeException(BIZTYPE_ADD_ALREADY_ERROR, type.getName(), type.getId());
  8. } else {
  9. LOGGER.error(new MetadataRuntimeException(BIZTYPE_ADD_ALREADY_ERROR, type.getName(), type.getId()));
  10. }
  11. }
  12. businessTypeMap.put(type.getId(), type);
  13. }
  14. }
  15. }

代码示例来源:origin: org.tinygroup/org.tinygroup.metadata

  1. public void addDefaultValues(DefaultValues defaultValues) {
  2. if (defaultValues != null
  3. && defaultValues.getDefaultValueList() != null) {
  4. for (DefaultValue defaultValue : defaultValues
  5. .getDefaultValueList()) {
  6. if (defaultValueMap.containsKey(defaultValue.getId())) {
  7. if (ConfigUtil.isCheckStrict()) {
  8. //重复id
  9. throw new MetadataRuntimeException(DEFAULTVALUE_ADD_ALREADY_ERROR, defaultValue.getName(), defaultValue.getId());
  10. } else {
  11. LOGGER.error(new MetadataRuntimeException(DEFAULTVALUE_ADD_ALREADY_ERROR, defaultValue.getName(), defaultValue.getId()));
  12. }
  13. }
  14. defaultValueMap.put(defaultValue.getId(), defaultValue);
  15. }
  16. }
  17. }

代码示例来源:origin: org.tinygroup/org.tinygroup.metadata

  1. @Override
  2. public void addDicts(Dicts dicts) {
  3. if (dicts != null
  4. && dicts.getDictList() != null) {
  5. for (Dict dict : dicts
  6. .getDictList()) {
  7. if (dictMap.containsKey(dict.getName())) {
  8. if (ConfigUtil.isCheckStrict()) {
  9. //重复id
  10. throw new MetadataRuntimeException(DICT_ADD_ALREADY_ERROR, dict.getName(), dict.getId());
  11. } else {
  12. LOGGER.error(new MetadataRuntimeException(DICT_ADD_ALREADY_ERROR, dict.getName(), dict.getId()));
  13. }
  14. }
  15. dictMap.put(dict.getName(), dict);
  16. }
  17. }
  18. }

代码示例来源:origin: org.tinygroup/org.tinygroup.metadata

  1. public void addStandardTypes(StandardTypes standardTypes) {
  2. if (standardTypes != null
  3. && standardTypes.getStandardTypeList() != null) {
  4. for (StandardType standardType : standardTypes
  5. .getStandardTypeList()) {
  6. if (standardMap.containsKey(standardType.getId())) {
  7. if (ConfigUtil.isCheckStrict()) {
  8. //重复id
  9. throw new MetadataRuntimeException(STDTYPE_ADD_ALREADY_ERROR, standardType.getName(), standardType.getId());
  10. } else {
  11. LOGGER.error(new MetadataRuntimeException(STDTYPE_ADD_ALREADY_ERROR, standardType.getName(), standardType.getId()));
  12. continue;
  13. }
  14. }
  15. standardMap.put(standardType.getId(), standardType);
  16. }
  17. }
  18. }

代码示例来源:origin: org.tinygroup/weblayer

  1. add(ParserWebContext.UPLOAD_SIZE_LIMIT_EXCEEDED,
  2. Boolean.TRUE);
  3. logger.error("File upload exceeds the size limit", e);
  4. } catch (UploadException e) {
  5. add(ParserWebContext.UPLOAD_FAILED, Boolean.TRUE);
  6. logger.error("Upload failed", e);

代码示例来源:origin: org.tinygroup/org.tinygroup.imda

  1. logger.error(e);
  2. context.put("exception", e);
  3. ByteArrayOutputStream buf = new ByteArrayOutputStream();
  4. .write(jsonConverter.convert(exceptionInfo));
  5. } catch (Exception e2) {
  6. logger.error(e2);

代码示例来源:origin: org.tinygroup/org.tinygroup.metadata

  1. public void addStandardFields(StandardFields standardFields) {
  2. if (standardFields != null
  3. && standardFields.getStandardFieldList() != null) {
  4. for (StandardField field : standardFields.getStandardFieldList()) {
  5. if (standardFieldMap.containsKey(field.getId())) {
  6. if (ConfigUtil.isCheckStrict()) {
  7. //重复id
  8. throw new MetadataRuntimeException(STDFIELD_ADD_ALREADY_ERROR, field.getId());
  9. } else {
  10. LOGGER.error(new MetadataRuntimeException(STDFIELD_ADD_ALREADY_ERROR, field.getId()));
  11. continue;
  12. }
  13. }
  14. standardFieldMap.put(field.getId(), field);
  15. if (field.getNickNames() != null) {
  16. for (NickName name : field.getNickNames()) {
  17. StandardField newStandardField = new StandardField();
  18. newStandardField.setId(name.getId());
  19. newStandardField.setName(name.getName());
  20. newStandardField.setTitle(name.getTitle());
  21. newStandardField.setDefaultValue(field.getDefaultValue());
  22. newStandardField.setDescription(field.getDescription());
  23. newStandardField.setTypeId(field.getTypeId());
  24. standardFieldMap.put(name.getId(), newStandardField);
  25. }
  26. }
  27. }
  28. }
  29. }

相关文章