Skip to content

Commit

Permalink
Merge pull request #13 from KostyaSha/JENKINS-26118
Browse files Browse the repository at this point in the history
[JENKINS-26118] Add details and optimize logging
  • Loading branch information
KostyaSha committed Dec 18, 2014
2 parents 14e42cd + dab7b16 commit 2f78ea5
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -56,7 +56,7 @@ public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) {

String regexpForRerun = naginator.getRegexpForRerun();
if ((regexpForRerun !=null) && (!regexpForRerun.equals(""))) {
LOGGER.log(Level.FINEST, "regexpForRerun - " + regexpForRerun);
LOGGER.log(Level.FINEST, "regexpForRerun - {0}", regexpForRerun);

try {
// If parseLog returns false, we didn't find the regular expression,
Expand All @@ -74,7 +74,8 @@ public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) {

if (canSchedule(build, naginator)) {
int n = naginator.getDelay().computeScheduleDelay(build);
LOGGER.log(Level.FINE, "about to try to schedule a build in " + n + " seconds");
LOGGER.log(Level.FINE, "about to try to schedule a build #{0} in {1} seconds for {2}",
new Object[]{build.getNumber(), n, build.getProject().getName()} );

List<Combination> combsToRerun = new ArrayList<Combination>();

Expand All @@ -92,7 +93,7 @@ public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) {
continue;
}

LOGGER.log(Level.FINE, "add combination to matrix rerun (" + r.getParent().getCombination().toString() + ")");
LOGGER.log(Level.FINE, "add combination to matrix rerun ({0})", r.getParent().getCombination().toString());
combsToRerun.add(r.getParent().getCombination());
}
}
Expand All @@ -107,7 +108,8 @@ public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) {
scheduleBuild(build, n);
}
} else {
LOGGER.log(Level.FINE, "max number of schedules for this build (#" + build.getNumber() + ")");
LOGGER.log(Level.FINE, "max number of schedules for #{0} build, project {1}",
new Object[]{build.getNumber(), build.getProject().getName()} );
}
}

Expand Down

0 comments on commit 2f78ea5

Please sign in to comment.