com.alipay.sofa.rpc.log.Logger.isErrorEnabled()方法的使用及代码示例

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

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

Logger.isErrorEnabled介绍

[英]Is error enabled boolean.
[中]是启用错误的布尔值。

代码示例

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled()) {
  LOGGER.error("Can't get valid host, will use 127.0.0.1 instead.");

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled()) {
  LOGGER.error("Can't get valid host, will use 127.0.0.1 instead.");

代码示例来源:origin: alipay/sofa-rpc

static List<String> loadFile(String path) {
  List<String> blackPrefixList = new ArrayList<String>();
  InputStream input = null;
  try {
    input = BlackListFileLoader.class.getResourceAsStream(path);
    if (input != null) {
      readToList(input, "UTF-8", blackPrefixList);
    }
    String overStr = SofaConfigs.getStringValue(SofaOptions.CONFIG_SERIALIZE_BLACKLIST_OVERRIDE, "");
    if (StringUtils.isNotBlank(overStr)) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Serialize blacklist will override with configuration: {}", overStr);
      }
      overrideBlackList(blackPrefixList, overStr);
    }
  } catch (Exception e) {
    if (LOGGER.isErrorEnabled()) {
      LOGGER.error(e.getMessage(), e);
    }
  } finally {
    closeQuietly(input);
  }
  return blackPrefixList;
}

代码示例来源:origin: alipay/sofa-rpc

static List<String> loadFile(String path) {
  List<String> blackPrefixList = new ArrayList<String>();
  InputStream input = null;
  try {
    input = BlackListFileLoader.class.getResourceAsStream(path);
    if (input != null) {
      readToList(input, "UTF-8", blackPrefixList);
    }
    String overStr = SofaConfigs.getStringValue(SofaOptions.CONFIG_SERIALIZE_BLACKLIST_OVERRIDE, "");
    if (StringUtils.isNotBlank(overStr)) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Serialize blacklist will override with configuration: {}", overStr);
      }
      overrideBlackList(blackPrefixList, overStr);
    }
  } catch (Exception e) {
    if (LOGGER.isErrorEnabled()) {
      LOGGER.error(e.getMessage(), e);
    }
  } finally {
    closeQuietly(input);
  }
  return blackPrefixList;
}

代码示例来源:origin: alipay/sofa-rpc

/**
 * @param path path必须以/结尾
 */
protected synchronized void loadFromFile(String path) {
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("Loading extension of extensible {} from path: {}", interfaceName, path);
  }
  // 默认如果不指定文件名字,就是接口名
  String file = StringUtils.isBlank(extensible.file()) ? interfaceName : extensible.file().trim();
  String fullFileName = path + file;
  try {
    ClassLoader classLoader = ClassLoaderUtils.getClassLoader(getClass());
    loadFromClassLoader(classLoader, fullFileName);
  } catch (Throwable t) {
    if (LOGGER.isErrorEnabled()) {
      LOGGER.error("Failed to load extension of extensible " + interfaceName + " from path:" + fullFileName,
        t);
    }
  }
}

代码示例来源:origin: alipay/sofa-rpc

/**
 * @param path path必须以/结尾
 */
protected synchronized void loadFromFile(String path) {
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("Loading extension of extensible {} from path: {}", interfaceName, path);
  }
  // 默认如果不指定文件名字,就是接口名
  String file = StringUtils.isBlank(extensible.file()) ? interfaceName : extensible.file().trim();
  String fullFileName = path + file;
  try {
    ClassLoader classLoader = ClassLoaderUtils.getClassLoader(getClass());
    loadFromClassLoader(classLoader, fullFileName);
  } catch (Throwable t) {
    if (LOGGER.isErrorEnabled()) {
      LOGGER.error("Failed to load extension of extensible " + interfaceName + " from path:" + fullFileName,
        t);
    }
  }
}

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled(consumerConfig.getAppName())) {
  LOGGER.errorWithApp(consumerConfig.getAppName(), "update " + consumerConfig.getInterfaceId() +
    " provider (" + providerGroup

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled(appName)) {
  LOGGER.errorWithApp(appName, e.getMessage(), e);

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled(appName)) {
  LOGGER.errorWithApp(appName, e.getMessage(), e);

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled(consumerConfig.getAppName())) {
  LOGGER.errorWithApp(consumerConfig.getAppName(), "update " + consumerConfig.getInterfaceId() +
    " provider (" + providerGroup

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled(appName)) {
  LOGGER.errorWithApp(appName, e.getMessage(), e);

代码示例来源:origin: alipay/sofa-rpc

if (LOGGER.isErrorEnabled(appName)) {
  LOGGER.errorWithApp(appName, e.getMessage(), e);

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

if (LOGGER.isErrorEnabled()) {
  LOGGER.error("Can't get valid host, will use 127.0.0.1 instead.");

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

static List<String> loadFile(String path) {
  List<String> blackPrefixList = new ArrayList<String>();
  InputStream input = null;
  try {
    input = BlackListFileLoader.class.getResourceAsStream(path);
    if (input != null) {
      readToList(input, "UTF-8", blackPrefixList);
    }
    String overStr = SofaConfigs.getStringValue(SofaOptions.CONFIG_SERIALIZE_BLACKLIST_OVERRIDE, "");
    if (StringUtils.isNotBlank(overStr)) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Serialize blacklist will override with configuration: {}", overStr);
      }
      overrideBlackList(blackPrefixList, overStr);
    }
  } catch (Exception e) {
    if (LOGGER.isErrorEnabled()) {
      LOGGER.error(e.getMessage(), e);
    }
  } finally {
    closeQuietly(input);
  }
  return blackPrefixList;
}

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

/**
 * @param path path必须以/结尾
 */
protected synchronized void loadFromFile(String path) {
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("Loading extension of extensible {} from path: {}", interfaceName, path);
  }
  // 默认如果不指定文件名字,就是接口名
  String file = StringUtils.isBlank(extensible.file()) ? interfaceName : extensible.file().trim();
  String fullFileName = path + file;
  try {
    ClassLoader classLoader = ClassLoaderUtils.getClassLoader(getClass());
    loadFromClassLoader(classLoader, fullFileName);
  } catch (Throwable t) {
    if (LOGGER.isErrorEnabled()) {
      LOGGER.error("Failed to load extension of extensible " + interfaceName + " from path:" + fullFileName,
        t);
    }
  }
}

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

if (LOGGER.isErrorEnabled(consumerConfig.getAppName())) {
  LOGGER.errorWithApp(consumerConfig.getAppName(), "update " + consumerConfig.getInterfaceId() +
    " provider (" + providerGroup

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

if (LOGGER.isErrorEnabled(appName)) {
  LOGGER.errorWithApp(appName, e.getMessage(), e);

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

if (LOGGER.isErrorEnabled(appName)) {
  LOGGER.errorWithApp(appName, e.getMessage(), e);

相关文章