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

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

本文整理了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

public synchronized void setObjectStorage(ObjectStorage objectStorage) {
  this.objectStorage = objectStorage;
  try {
    List<Work> works = objectStorage.loadObjects("Work");
    this.workList.addAll(works);
  } catch (Exception e) {
    LOGGER.error(e);
  }
}

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

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

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

private int select(int[] areaEnds) {
  int sum = areaEnds[areaEnds.length - 1];
  if (sum == 0) {
    logger.error("ERROR ## areaEnds: " + intArray2String(areaEnds));
    return -1;
  }
  int rand = random.nextInt(sum);
  for (int i = 0; i < areaEnds.length; i++) {
    if (rand < areaEnds[i]) {
      return i;
    }
  }
  return -1;
}

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

/**
 * 从AnnotationClassAction接入,新增注解服务
 *
 * @param clazz
 * @param annotation
 * @param serviceRegistry
 */
public void loadService(Class<?> clazz, Annotation annotation,
            ServiceRegistry serviceRegistry) {
  String className = clazz.getName();
  LOGGER.logMessage(LogLevel.INFO, "从{}中查找ServiceAnnotation", className);
  try {
    registerServices(clazz, annotation, serviceRegistry);
  } catch (Exception e) {
    LOGGER.error("service.loadServiceException", e, className);
  }
}

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

/**
 * 
 * 从AnnotationClassAction接入,新增注解服务
 * 
 * @param clazz
 * @param annotation
 * @param serviceRegistry
 */
public void loadService(Class<?> clazz, Annotation annotation,
    ServiceRegistry serviceRegistry) {
  String className = clazz.getName();
  logger.logMessage(LogLevel.INFO, "从{}中查找ServiceAnnotation", className);
  try {
    registerServices(clazz, annotation, serviceRegistry);
  } catch (Exception e) {
    logger.error("service.loadServiceException", e, className);
  }
}

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

/**
 *
 * @param request
 * @param response
 * @param handler
 * @param ex
 * @return
 */
@ResponseBody
public ModelAndView resolveException(HttpServletRequest request,
    HttpServletResponse response, Object handler, Exception ex) {
  
  logger.error(ex);
  String message = null;
  ModelAndView model = new ModelAndView();
  //判断是否ajax
  if((request.getHeader("X-Requested-With") != null  && "XMLHttpRequest".equals( request.getHeader("X-Requested-With").toString()))){
    MappingJackson2JsonView view = new MappingJackson2JsonView();
    Map attributes = new HashMap();
    attributes.put("status", Boolean.TRUE);
    attributes.put("info", message);
    view.setAttributesMap(attributes);
    model.setView(view);
  }else{
    model.setViewName("/syserror/error");
  }
  return model;
}

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

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

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

/**
   * 转换XML为Xstream对象
   *
   * @param <T>
   * @param stream
   * @param fileObject
   * @return
   */
  @SuppressWarnings("unchecked")
  protected <T> T convertFromXml(XStream stream, FileObject fileObject) {
    InputStream inputStream = null;
    try {
      inputStream = fileObject.getInputStream();
      return (T) stream.fromXML(inputStream);
    } catch (Exception e) {
      throw new RuntimeException("转换XML文件成Xstream对象发生异常,路径:" + fileObject.getAbsolutePath(), e);
    } finally {
      if (inputStream != null) {
        try {
          inputStream.close();
        } catch (Exception e) {
          LOGGER.error("关闭文件流时出错,文件路径:{}", e, fileObject.getAbsolutePath());
        }
      }
    }
  }
}

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

private void forward(WebContext context, ModelRequestInfo modelRequestInfo,
    String path) {
  String[] paths = path.split("[?]");
  HttpServletRequest request = context.getRequest();
  if (modelRequestInfo.pagelet && paths[0].endsWith(".page")) {
    paths[0] += "let";
  }
  String p = paths[0];
  if (paths.length == 2) {
    p = p + "?" + paths[1];
  }
  VelocityHelperImpl velocityHelper = SpringUtil
      .getBean("velocityHelper");
  StringWriter out = new StringWriter();
  velocityHelper.evaluteString(context, out, p);
  String forwardPath = out.toString();
  logger.logMessage(LogLevel.INFO, "重新转向到地址:{}", forwardPath);
  try {
    request.getRequestDispatcher(forwardPath).forward(request,
        context.getResponse());
  } catch (Exception e1) {
    logger.error(e1);
  }
}

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

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

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

/**
 * 载入服务
 */
public void loadService(ServiceRegistry serviceRegistry)
    throws ServiceLoadException {
  List<String> classNames = getClassNames();// 这个由子类提供
  for (String className : classNames) {
    try {
      logger.logMessage(LogLevel.INFO,
          "从{className}中查找ServiceAnnotation", className);
      Class<?> clazz = Class.forName(className);
      Annotation annotation = clazz
          .getAnnotation(ServiceComponent.class);
      if (annotation != null) {
        registerServices(clazz, annotation, serviceRegistry);
      } else {
        logger.logMessage(LogLevel.INFO,
            "{className}中无ServiceAnnotation", className);
      }
      logger.logMessage(LogLevel.INFO,
          "从{className}中查找ServiceAnnotation完成", className);
    } catch (Exception e) {
      logger.error("service.loadServiceException", e, className);
    }
  }
}

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

/**
 * 载入服务
 */
public void loadService(ServiceRegistry serviceRegistry, ClassLoader classLoader)
    throws ServiceLoadException {
  List<String> classNames = getClassNames();// 这个由子类提供
  for (String className : classNames) {
    try {
      LOGGER.logMessage(LogLevel.INFO,
          "从{className}中查找ServiceAnnotation", className);
      Class<?> clazz = classLoader.loadClass(className);
      Annotation annotation = clazz
          .getAnnotation(ServiceComponent.class);
      if (annotation != null) {
        registerServices(clazz, annotation, serviceRegistry);
      } else {
        LOGGER.logMessage(LogLevel.INFO,
            "{className}中无ServiceAnnotation", className);
      }
      LOGGER.logMessage(LogLevel.INFO,
          "从{className}中查找ServiceAnnotation完成", className);
    } catch (Exception e) {
      LOGGER.error("service.loadServiceException", e, className);
    }
  }
}

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

public void addBusinessTypes(BusinessTypes businessTypes) {
  if (businessTypes != null && businessTypes.getBusinessTypeList() != null) {
    for (BusinessType type : businessTypes.getBusinessTypeList()) {
      if (businessTypeMap.containsKey(type.getId())) {
        if (ConfigUtil.isCheckStrict()) {
          //重复id
          throw new MetadataRuntimeException(BIZTYPE_ADD_ALREADY_ERROR, type.getName(), type.getId());
        } else {
          LOGGER.error(new MetadataRuntimeException(BIZTYPE_ADD_ALREADY_ERROR, type.getName(), type.getId()));
        }
      }
      businessTypeMap.put(type.getId(), type);
    }
  }
}

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

public void addDefaultValues(DefaultValues defaultValues) {
  if (defaultValues != null
      && defaultValues.getDefaultValueList() != null) {
    for (DefaultValue defaultValue : defaultValues
        .getDefaultValueList()) {
      if (defaultValueMap.containsKey(defaultValue.getId())) {
        if (ConfigUtil.isCheckStrict()) {
          //重复id
          throw new MetadataRuntimeException(DEFAULTVALUE_ADD_ALREADY_ERROR, defaultValue.getName(), defaultValue.getId());
        } else {
          LOGGER.error(new MetadataRuntimeException(DEFAULTVALUE_ADD_ALREADY_ERROR, defaultValue.getName(), defaultValue.getId()));
        }
      }
      defaultValueMap.put(defaultValue.getId(), defaultValue);
    }
  }
}

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

@Override
public void addDicts(Dicts dicts) {
  if (dicts != null
      && dicts.getDictList() != null) {
    for (Dict dict : dicts
        .getDictList()) {
      if (dictMap.containsKey(dict.getName())) {
        if (ConfigUtil.isCheckStrict()) {
          //重复id
          throw new MetadataRuntimeException(DICT_ADD_ALREADY_ERROR, dict.getName(), dict.getId());
        } else {
          LOGGER.error(new MetadataRuntimeException(DICT_ADD_ALREADY_ERROR, dict.getName(), dict.getId()));
        }
      }
      dictMap.put(dict.getName(), dict);
    }
  }
}

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

public void addStandardTypes(StandardTypes standardTypes) {
  if (standardTypes != null
      && standardTypes.getStandardTypeList() != null) {
    for (StandardType standardType : standardTypes
        .getStandardTypeList()) {
      if (standardMap.containsKey(standardType.getId())) {
        if (ConfigUtil.isCheckStrict()) {
          //重复id
          throw new MetadataRuntimeException(STDTYPE_ADD_ALREADY_ERROR, standardType.getName(), standardType.getId());
        } else {
          LOGGER.error(new MetadataRuntimeException(STDTYPE_ADD_ALREADY_ERROR, standardType.getName(), standardType.getId()));
          continue;
        }
      }
      standardMap.put(standardType.getId(), standardType);
    }
  }
}

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

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

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

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

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

public void addStandardFields(StandardFields standardFields) {
  if (standardFields != null
      && standardFields.getStandardFieldList() != null) {
    for (StandardField field : standardFields.getStandardFieldList()) {
      if (standardFieldMap.containsKey(field.getId())) {
        if (ConfigUtil.isCheckStrict()) {
          //重复id
          throw new MetadataRuntimeException(STDFIELD_ADD_ALREADY_ERROR, field.getId());
        } else {
          LOGGER.error(new MetadataRuntimeException(STDFIELD_ADD_ALREADY_ERROR, field.getId()));
          continue;
        }
      }
      standardFieldMap.put(field.getId(), field);
      if (field.getNickNames() != null) {
        for (NickName name : field.getNickNames()) {
          StandardField newStandardField = new StandardField();
          newStandardField.setId(name.getId());
          newStandardField.setName(name.getName());
          newStandardField.setTitle(name.getTitle());
          newStandardField.setDefaultValue(field.getDefaultValue());
          newStandardField.setDescription(field.getDescription());
          newStandardField.setTypeId(field.getTypeId());
          standardFieldMap.put(name.getId(), newStandardField);
        }
      }
    }
  }
}

相关文章