Skip to content

Commit

Permalink
JENKINS-32498 logger fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nbali committed Jan 21, 2016
1 parent 42ce4f2 commit 12c6e53
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -18,6 +18,7 @@
import hudson.tasks.Publisher;
import hudson.util.FormValidation;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.eclipse.jgit.transport.RemoteConfig;
Expand Down Expand Up @@ -79,8 +80,9 @@ public boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener) {
this.notifyBuildStatus(buildStatusResource, buildStatus);
listener.getLogger().println("Sending build status " + buildStatus.getState() + " to BitBucket is done!");
} catch (Exception e) {
logger.info("Bitbucket notify on start failed: " + e.getMessage());
logger.log(Level.INFO, "Bitbucket notify on start failed: " + e.getMessage(), e);
listener.getLogger().println("Bitbucket notify on start failed: " + e.getMessage());
e.printStackTrace(listener.getLogger());
}

logger.info("Bitbucket notify on start succeeded");
Expand All @@ -102,8 +104,9 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
this.notifyBuildStatus(buildStatusResource, buildStatus);
listener.getLogger().println("Sending build status " + buildStatus.getState() + " to BitBucket is done!");
} catch (Exception e) {
logger.info("Bitbucket notify on finish failed: " + e.getMessage());
logger.log(Level.INFO, "Bitbucket notify on finish failed: " + e.getMessage(), e);
listener.getLogger().println("Bitbucket notify on finish failed: " + e.getMessage());
e.printStackTrace(listener.getLogger());
}

logger.info("Bitbucket notify on finish succeeded");
Expand Down

0 comments on commit 12c6e53

Please sign in to comment.