com.alibaba.dubbo.common.logger.Logger类的使用及代码示例

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

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

Logger介绍

[英]日志接口

声明:引用自commons-logging
[中]日志接口
声明:引用自公用记录

代码示例

代码示例来源:origin: com.alibaba/dubbo

public static void warn(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void error(Throwable e) {
  try {
    logger.error(e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static void info(Logger logger, String msg) {
  if (logger == null) {
    return;
  }
  if (logger.isInfoEnabled()) {
    logger.info(msg);
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static void debug(Logger logger, String msg, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isDebugEnabled()) {
    logger.debug(msg, e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void warn(Throwable e) {
  try {
    logger.warn(e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
  public void run() {
    try {
      client = listenableFutureTask.get();
      client.subscribeStateChanges(listener);
    } catch (InterruptedException e) {
      logger.warn(Thread.currentThread().getName() + " was interrupted unexpectedly, which may cause unpredictable exception!");
    } catch (ExecutionException e) {
      logger.error("Got an exception when trying to create zkclient instance, can not connect to zookeeper server, please check!", e);
    }
  }
});

代码示例来源:origin: com.alibaba/dubbo-common

@Override
public void info(Throwable e) {
  try {
    logger.info(e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public boolean isWarnEnabled() {
  try {
    return logger.isWarnEnabled();
  } catch (Throwable t) {
    return false;
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void debug(Throwable e) {
  try {
    logger.debug(e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static boolean initConsumerModel(String serviceName, ConsumerModel consumerModel) {
  if (consumedServices.putIfAbsent(serviceName, consumerModel) != null) {
    logger.warn("Already register the same consumer:" + serviceName);
    return false;
  }
  return true;
}

代码示例来源:origin: linux-china/dubbo3

public static void debug(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isDebugEnabled()) {
    logger.debug(e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public Object aroundReadFrom(ReaderInterceptorContext context) throws IOException, WebApplicationException {
  byte[] buffer = IOUtils.toByteArray(context.getInputStream());
  logger.info("The contents of request body is: \n" + new String(buffer, "UTF-8") + "\n");
  context.setInputStream(new ByteArrayInputStream(buffer));
  return context.proceed();
}

代码示例来源:origin: com.alibaba/dubbo-common

@Override
public boolean isWarnEnabled() {
  try {
    return logger.isWarnEnabled();
  } catch (Throwable t) {
    return false;
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void debug(String msg, Throwable e) {
  try {
    logger.debug(appendContextMessage(msg), e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static void info(Logger logger, String msg, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isInfoEnabled()) {
    logger.info(msg, e);
  }
}

代码示例来源:origin: com.alibaba/dubbo-common

public static void warn(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static void initProviderModel(String serviceName, ProviderModel providerModel) {
  if (providedServices.put(serviceName, providerModel) != null) {
    logger.warn("already register the provider service: " + serviceName);
    return;
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
  public void run() {
    // Check and connect to the registry
    try {
      connect();
    } catch (Throwable t) { // Defensive fault tolerance
      logger.error("Unexpected error occur at reconnect, cause: " + t.getMessage(), t);
    }
  }
}, reconnectPeriod, reconnectPeriod, TimeUnit.MILLISECONDS);

代码示例来源:origin: linux-china/dubbo3

public static void debug(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isDebugEnabled()) {
    logger.debug(e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void debug(String msg) {
  try {
    logger.debug(appendContextMessage(msg));
  } catch (Throwable t) {
  }
}

相关文章