io.fabric8.maven.docker.util.Logger.isDebugEnabled()方法的使用及代码示例

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

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

Logger.isDebugEnabled介绍

[英]Whether debugging is enabled.
[中]是否启用调试。

代码示例

代码示例来源:origin: fabric8io/docker-maven-plugin

@Override
protected void processLine(String line) {
  if (log.isDebugEnabled()) {
    log.verbose("%s", line);
  }
  if (line.startsWith(prefix)) {
    setEnvironmentVariable(line.substring(prefix.length()));
  }
}

代码示例来源:origin: fabric8io/docker-maven-plugin

@Override
public void write(byte[] b, int off, int len) throws IOException {
  if(log.isDebugEnabled()){
    String request = new String(b, off, len, Charset.forName("UTF-8"));
    String logValue = ascii().matchesAllOf(request) ? request : "not logged due to non-ASCII characters. ";
    log.debug("REQUEST %s", logValue);
  }
  out.write(b, off, len);
}

代码示例来源:origin: fabric8io/docker-maven-plugin

@Override
public boolean removeImage(String image, boolean... forceOpt) throws DockerAccessException {
  boolean force = forceOpt != null && forceOpt.length > 0 && forceOpt[0];
  try {
    String url = urlBuilder.deleteImage(image, force);
    HttpBodyAndStatus response = delegate.delete(url, new BodyAndStatusResponseHandler(), HTTP_OK, HTTP_NOT_FOUND);
    if (log.isDebugEnabled()) {
      logRemoveResponse(JsonFactory.newJsonArray(response.getBody()));
    }
    return response.getStatusCode() == HTTP_OK;
  } catch (IOException e) {
    throw new DockerAccessException(e, "Unable to remove image [%s]", image);
  }
}

代码示例来源:origin: fabric8io/docker-maven-plugin

@Override
public boolean check() {
  try {
    final ContainerDetails container = docker.getContainer(containerId);
    if (container == null) {
      log.debug("HealthWaitChecker: Container %s not found");
      return false;
    }
    if (container.getHealthcheck() == null) {
      throw new IllegalArgumentException("Can not wait for healthstate of " + imageConfigDesc +". No HEALTHCHECK configured.");
    }
    if (first) {
      log.info("%s: Waiting to become healthy", imageConfigDesc);
      log.debug("HealthWaitChecker: Waiting for healthcheck: '%s'", container.getHealthcheck());
      first = false;
    } else if (log.isDebugEnabled()) {
      log.debug("HealthWaitChecker: Waiting on healthcheck '%s'", container.getHealthcheck());
    }
    return container.isHealthy();
  } catch(DockerAccessException e) {
    log.warn("Error while checking health: %s", e.getMessage());
    return false;
  }
}

代码示例来源:origin: fabric8io/fabric8-maven-plugin

@Override
public boolean isDebugEnabled() {
  return log.isDebugEnabled();
}

相关文章