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

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

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

Logger.info介绍

[英]Informational message
[中]信息性消息

代码示例

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

@Override
public void matched() {
  latch.countDown();
  log.info("Pattern '%s' matched for container %s", logPattern, containerId);
}

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

private void inputStreamPump(OutputStream outputStream,String processInput) throws IOException {
  try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream))) {
    if (processInput != null) {
      writer.write(processInput);
      writer.flush();
    }
  } catch (IOException e) {
    log.info("Failed to close process output stream: %s", e.getMessage());
  }
}

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

private void logInfoMessage(JsonObject json) {
  String value;
  if (json.has("stream")) {
    value = json.get("stream").getAsString().replaceFirst("\n$", "");
  } else if (json.has("status")) {
    value = json.get("status").getAsString();
  } else {
    value = json.toString();
  }
  log.info("%s", value);
}

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

@Override
protected void processLine(String line) {
  log.info("Docker machine \"%s\" is %s",machine.getName(),line.toLowerCase());
  if ("Running".equals(line)) {
    status = Status.Running;
  } else if ("Stopped".equals(line)) {
    status = Status.Stopped;
  } else {
    message = "Unknown status - " + line;
  }
}

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

@Override
protected void start() {
  log.info("Regenerating certificates for \"%s\"", machine.getName());
  start = System.currentTimeMillis();
}

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

private void callBuildPlugin(File outputDir, String buildPluginClass) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  Class buildPlugin = Class.forName(buildPluginClass);
  try {
    Method method = buildPlugin.getMethod("addExtraFiles", File.class);
    method.invoke(null, outputDir);
    log.info("Extra files from %s extracted", buildPluginClass);
  } catch (NoSuchMethodException exp) {
    log.verbose("Build plugin %s does not support 'addExtraFiles' method", buildPluginClass);
  }
}

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

@Override
  protected void end() {
    log.info("Started docker machine \"%s\" in %d seconds",machine.getName(), (System.currentTimeMillis() - start) / 1000);
  }
}

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

@Override
  protected void end() {
    log.info("Created docker machine \"%s\" in %d seconds",machine.getName(), (System.currentTimeMillis() - start) / 1000);
  }
}

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

@Override
protected void start() {
  log.info("Starting docker machine \"%s\"", machine.getName());
  start = System.currentTimeMillis();
}

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

@Override
  protected void end() {
    log.info("Regenerated certificates for \"%s\" in %d seconds",machine.getName(), (System.currentTimeMillis() - start) / 1000);
  }
}

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

@Override
protected void start() {
  log.info("Creating docker machine \"%s\" with args %s",
       machine.getName(),
       machine.getCreateOptions() != null ? machine.getCreateOptions().toString() : "");
  log.info("This might take a while ...");
  start = System.currentTimeMillis();
}

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

private List<StartOrderResolver.Resolvable> convertToResolvables(List<ImageConfiguration> images) {
  List<StartOrderResolver.Resolvable> ret = new ArrayList<>();
  for (ImageConfiguration config : images) {
    if (config.getRunConfiguration().skip()) {
      log.info("%s: Skipped running", config.getDescription());
    } else {
      ret.add(config);
    }
  }
  return ret;
}

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

public synchronized DockerConnectionDetector.ConnectionParameter getConnectionParameter(String certPath) throws IOException {
  if (machine == null) {
    return null;
  }
  if (envMap == null) {
    envMap = getEnvironment();
  }
  String value = envMap.get("DOCKER_HOST");
  if (value == null) {
    return null;
  }
  log.info("DOCKER_HOST from docker-machine \"%s\" : %s", machine.getName(), value);
  return new DockerConnectionDetector.ConnectionParameter(value, certPath != null ? certPath : envMap.get("DOCKER_CERT_PATH"));
}

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

@Override
protected void executeInternal(ServiceHub serviceHub) throws DockerAccessException, MojoExecutionException {
  if (getVolumes() == null) {
    log.info("No volume configuration found.");
    return;
  }
  VolumeService volService = serviceHub.getVolumeService();
  for (VolumeConfiguration volume : getVolumes()) {
    log.info("Creating volume '%s'", volume.getName());
    volService.createVolume(volume);
  }
}

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

private void startContainer(ImageConfiguration imageConfig, String id, GavLabel gavLabel) throws DockerAccessException {
  log.info("%s: Start container %s",imageConfig.getDescription(), id);
  docker.startContainer(id);
  tracker.registerContainer(id, imageConfig, gavLabel);
}

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

@Override
protected void executeInternal(ServiceHub serviceHub)
   throws DockerAccessException, MojoExecutionException  {
  if(getVolumes() == null){
    log.info("No volume configuration found.");
    return;
  }
  VolumeService volService = serviceHub.getVolumeService();
  for ( VolumeConfiguration volume : getVolumes()) {
    log.info("Removing volume %s", volume.getName());
    volService.removeVolume(volume.getName());
  }
}

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

private void removeImage(ServiceHub hub, String name) throws DockerAccessException {
  QueryService queryService = hub.getQueryService();
  if (queryService.hasImage(name)) {
    if (hub.getDockerAccess().removeImage(name,true)) {
      log.info("%s: Remove", name);
    }
  }
}

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

/**
 * Create the tar file container the source for building an image. This tar can be used directly for
 * uploading to a Docker daemon for creating the image
 *
 * @param imageConfig the image configuration
 * @param params mojo params for the project
 * @param customizer final customizer to be applied to the tar before being generated
 * @return file for holding the sources
 * @throws MojoExecutionException if during creation of the tar an error occurs.
 */
public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params, ArchiverCustomizer customizer)
    throws MojoExecutionException {
  File ret = createArchive(imageConfig.getName(), imageConfig.getBuildConfiguration(), params, log, customizer);
  log.info("%s: Created docker source tar %s",imageConfig.getDescription(), ret);
  return ret;
}

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

public void tagImage(String imageName, ImageConfiguration imageConfig) throws DockerAccessException {
  List<String> tags = imageConfig.getBuildConfiguration().getTags();
  if (tags.size() > 0) {
    log.info("%s: Tag with %s", imageConfig.getDescription(), EnvUtil.stringJoin(tags, ","));
    for (String tag : tags) {
      if (tag != null) {
        docker.tag(imageName, new ImageName(imageName, tag).getFullName(), true);
      }
    }
    log.debug("Tagging image successful!");
  }
}

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

@Override
protected void executeInternal(ServiceHub serviceHub) throws DockerAccessException, MojoExecutionException {
  if (skipSave) {
    return;
  }
  String imageName = getImageName();
  String fileName = getFileName(imageName);
  ensureSaveDir(fileName);
  log.info("Saving image %s to %s", imageName, fileName);
  if (!serviceHub.getQueryService().hasImage(imageName)) {
    throw new MojoExecutionException("No image " + imageName + " exists");
  }
  serviceHub.getDockerAccess().saveImage(imageName, fileName, ArchiveCompression.fromFileName(fileName));
}

相关文章