Skip to content

Commit

Permalink
Merge pull request #73 from salesforce/improve-diagnostic-logs
Browse files Browse the repository at this point in the history
Improve context in diagnostic logs
  • Loading branch information
afalko committed Jun 14, 2019
2 parents 5aac8c9 + 0867228 commit 3bf9996
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGit
changeDockerfiles(ns, pathToDockerfilesInParentRepo, imagesFoundInParentRepo, imageToTagMap, currUserRepo,
skippedRepos);
} catch (IOException e) {
log.error(String.format("Error changing Dockerfile for %s", currUserRepo.getName()), e);
exceptions.add(e);
}
}

if (!exceptions.isEmpty()) {
log.info("There were {} errors with changing Dockerfiles.", exceptions.size());
throw exceptions.get(0);
throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size()));
}

if (!skippedRepos.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public void execute(final Namespace ns, DockerfileGitHubUtil dockerfileGitHubUti
try {
changeDockerfiles(ns, pathToDockerfilesInParentRepo, currUserRepo, skippedRepos);
} catch (IOException e) {
log.error(String.format("Error changing Dockerfile for %s", currUserRepo.getName()), e);
exceptions.add(e);
}
}
if (!exceptions.isEmpty()) {
log.info("There were {} errors with changing Dockerfiles.", exceptions.size());
throw exceptions.get(0);
throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size()));
}

if (!skippedRepos.isEmpty()) {
Expand Down Expand Up @@ -142,7 +142,7 @@ protected Multimap<String, String> forkRepositoriesFoundAndGetPathToDockerfiles(
}
}

log.info("Path to Dockerfiles in repo '{}': {}", parentRepoName, pathToDockerfilesInParentRepo);
log.info("Path to Dockerfiles in repos: {}", pathToDockerfilesInParentRepo);

return pathToDockerfilesInParentRepo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public PagedIterable<GHRepository> getGHRepositories(Multimap<String, String> pa
boolean listOfReposHasRecentForks = true;
for (String s : pathToDockerfileInParentRepo.keySet()) {
String forkName = s.substring(s.lastIndexOf('/') + 1);
log.info(forkName);
log.info(String.format("Verifying that %s has been forked", forkName));
if (!repoNamesSet.contains(forkName)) {
log.debug("Forking is still in progress for {}" , forkName);
listOfReposHasRecentForks = false;
Expand Down

0 comments on commit 3bf9996

Please sign in to comment.