Permalink
Browse files

improved logging

  • Loading branch information...
1 parent f9593d5 commit faf0116005af3d1bab472f2ed727c5ca2d6bed62 @lrytz committed Apr 16, 2012
Showing with 10 additions and 6 deletions.
  1. +6 −3 app/controllers/Application.scala
  2. +4 −3 app/controllers/jenkins/JenkinsTools.scala
@@ -224,7 +224,8 @@ object Application extends Controller {
private[controllers] def doRefreshAll() {
for (commit <- Commit.runningCommits) {
Logger("refreshing build "+ commit)
- submitBuildTask(commit.sha, doRefresh(commit.sha))
+ val ok = submitBuildTask(commit.sha, doRefresh(commit.sha))
+ if (!ok) Logger.info("could not refresh build "+ commit.sha)
}
}
@@ -308,8 +309,10 @@ object Application extends Controller {
//val newCommits = GithubTools.revisionStream().takeWhile(_.sha != latest.sha).toList
Logger.info("Fetched new commits: "+ newCommits)
Commit.addCommits(newCommits)
- for (commit <- newCommits)
- submitBuildTask(commit.sha, doStartBuild(commit.sha))
+ for (commit <- newCommits) {
+ val ok = submitBuildTask(commit.sha, doStartBuild(commit.sha))
+ if (!ok) Logger.error("failed to start build for new commit "+ commit.sha)
+ }
}
}
}
@@ -35,8 +35,9 @@ object JenkinsTools {
}
})
val builds = (res \ "builds").arrayValues.map(_.convertTo[JenkinsBuild])
- Logger.info("existing builds: "+ builds)
- builds.map(_.number)
+ val r = builds.map(_.number)
+ Logger.info("existing builds: "+ r)
+ r
}
def buildStream(buildIds: List[Int] = existingBuilds()): Stream[JenkinsBuildInfo] = buildIds match {
@@ -110,7 +111,7 @@ object JenkinsTools {
result
}
})
- Logger.info("started build, http result "+ res)
+ Logger.info("started jenkins build for "+ sha)
true
}

0 comments on commit faf0116

Please sign in to comment.