Skip to content

Commit

Permalink
[JENKINS-22395] Yet more diagnostics.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Apr 29, 2014
1 parent c1fcb08 commit 3ef8063
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/Run.java
Expand Up @@ -435,7 +435,7 @@ public void setResult(Result r) {
// result can only get worse
if (result==null || r.isWorseThan(result)) {
result = r;
LOGGER.log(FINE, this + " : result is set to " + r, LOGGER.isLoggable(Level.FINER) ? new Exception() : null);
LOGGER.log(FINE, this + " in " + getRootDir() + ": result is set to " + r, LOGGER.isLoggable(Level.FINER) ? new Exception() : null);
}
}

Expand Down Expand Up @@ -1451,7 +1451,7 @@ public synchronized void deleteArtifacts() throws IOException {
public void delete() throws IOException {
File rootDir = getRootDir();
if (!rootDir.isDirectory()) {
throw new IOException(this + ": " + rootDir + " looks to have already been deleted");
throw new IOException(this + ": " + rootDir + " looks to have already been deleted; siblings: " + Arrays.toString(project.getBuildDir().list()));
}

RunListener.fireDeleted(this);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/tasks/LogRotator.java
Expand Up @@ -108,7 +108,7 @@ public LogRotator(int daysToKeep, int numToKeep, int artifactDaysToKeep, int art

@SuppressWarnings("rawtypes")
public void perform(Job<?,?> job) throws IOException, InterruptedException {
LOGGER.log(FINE, "Running the log rotation for {0}", job);
LOGGER.log(FINE, "Running the log rotation for {0} with numToKeep={1} daysToKeep={2} artifactNumToKeep={3} artifactDaysToKeep={4}", new Object[] {job, numToKeep, daysToKeep, artifactNumToKeep, artifactDaysToKeep});

// always keep the last successful and the last stable builds
Run lsb = job.getLastSuccessfulBuild();
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/jenkins/model/StandardArtifactManager.java
Expand Up @@ -32,6 +32,8 @@
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.util.VirtualFile;

/**
Expand All @@ -41,6 +43,8 @@
*/
public class StandardArtifactManager extends ArtifactManager {

private static final Logger LOG = Logger.getLogger(StandardArtifactManager.class.getName());

protected transient Run<?,?> build;

public StandardArtifactManager(Run<?,?> build) {
Expand All @@ -60,8 +64,10 @@ public StandardArtifactManager(Run<?,?> build) {
@Override public final boolean delete() throws IOException, InterruptedException {
File ad = getArtifactsDir();
if (!ad.exists()) {
LOG.log(Level.FINE, "no such directory {0} to delete for {1}", new Object[] {ad, build});
return false;
}
LOG.log(Level.FINE, "deleting {0} for {1}", new Object[] {ad, build});
Util.deleteRecursive(ad);
return true;
}
Expand Down

0 comments on commit 3ef8063

Please sign in to comment.