From 31352723c7df6f5eb87e519fae84c79338ed4b34 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Tue, 17 May 2016 12:59:17 -0500 Subject: [PATCH] Rely on log4j to appropriately filter logging based on level-based methods. --- resources/log4j.properties | 5 +++-- src/com/jdbernard/teammaker/OddsCalculator.groovy | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/log4j.properties b/resources/log4j.properties index aff155b..ca27b83 100644 --- a/resources/log4j.properties +++ b/resources/log4j.properties @@ -1,5 +1,6 @@ -log4j.rootLogger=TRACE,stdout -log4j.com.jdbernard.teammaker=TRACE,file +log4j.rootLogger=INFO,stdout +#log4j.com.jdbernard.teammaker=TRACE,file +log4j.com.jdbernard.teammaker.OddsCalculator=TRACE,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout diff --git a/src/com/jdbernard/teammaker/OddsCalculator.groovy b/src/com/jdbernard/teammaker/OddsCalculator.groovy index 4043f2a..5ef5735 100644 --- a/src/com/jdbernard/teammaker/OddsCalculator.groovy +++ b/src/com/jdbernard/teammaker/OddsCalculator.groovy @@ -10,7 +10,7 @@ public class OddsCalculator { public void recalculate(List players, int spotsOpen, PlayerChooser chooser) { - if (log.isTraceEnabled()) log.trace("Recalculating odds.") + log.trace("Recalculating odds.") // reset computed player odds odds = [:] @@ -38,6 +38,8 @@ public class OddsCalculator { def oddsList = buildOdds([], players, spotsOpen, chooser) + if (log.isTraceEnabled()) log.trace(oddsList.toString()) + /* The oddsMap is a condensed version of the oddsList, calculating * the overall probability of each path:: * @@ -80,7 +82,7 @@ public class OddsCalculator { odds[(player)] = playerOdds } - if (log.isTraceEnabled()) log.trace("Finished recalculating odds.") + log.trace("Finished recalculating odds.") } protected List buildOdds(List chosenPath, List players, int spotsOpen,