From 43ab10be1c634f88d08f666df71ff15427e8a3d2 Mon Sep 17 00:00:00 2001 From: sboeschhuawei Date: Wed, 28 Jan 2015 11:55:09 -0800 Subject: [PATCH] Change last two println's to log4j logger --- .../apache/spark/mllib/clustering/PIClusteringSuite.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mllib/src/test/scala/org/apache/spark/mllib/clustering/PIClusteringSuite.scala b/mllib/src/test/scala/org/apache/spark/mllib/clustering/PIClusteringSuite.scala index 46f6cc8619d01..b9ccf1423a49a 100644 --- a/mllib/src/test/scala/org/apache/spark/mllib/clustering/PIClusteringSuite.scala +++ b/mllib/src/test/scala/org/apache/spark/mllib/clustering/PIClusteringSuite.scala @@ -65,7 +65,7 @@ class PIClusteringSuite extends FunSuite with LocalSparkContext { val nVertices = vertices.length val (ccenters, estCollected) = PIC.run(sc, vertices, nClusters, nIterations) - println(s"Cluster centers: ${ccenters.mkString(",")} " + + logger.info(s"Cluster centers: ${ccenters.mkString(",")} " + s"\nEstimates: ${estCollected.mkString("[", ",", "]")}") assert(ccenters.size == circleSpecs.length, "Did not get correct number of centers") @@ -108,6 +108,7 @@ class PIClusteringSuite extends FunSuite with LocalSparkContext { } object PIClusteringSuite { + val logger = Logger.getLogger(getClass.getName) val LA = PICLinalg val A = Array @@ -141,7 +142,7 @@ object PIClusteringSuite { circlePoints } val points = circles.flatten.sortBy(_.label) - println(printPoints(points)) + logger.info(printPoints(points)) points } @@ -158,7 +159,7 @@ object PIClusteringSuite { ) val aMat = new BDM(dat1.length, dat1.length, dat1.flatten) - println(s"Input mat: ${LA.printMatrix(dat1.flatten, 4, 4)}") + logger.info(s"Input mat: ${LA.printMatrix(dat1.flatten, 4, 4)}") val Darrarr = dat1.toArray.zipWithIndex.map { case (dvect, ix) => val sum = dvect.foldLeft(0.0) { _ + _