Rely on log4j to appropriately filter logging based on level-based methods.

This commit is contained in:
Jonathan Bernard 2016-05-17 12:59:17 -05:00
parent 4c915b33f5
commit 31352723c7
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
log4j.rootLogger=TRACE,stdout log4j.rootLogger=INFO,stdout
log4j.com.jdbernard.teammaker=TRACE,file #log4j.com.jdbernard.teammaker=TRACE,file
log4j.com.jdbernard.teammaker.OddsCalculator=TRACE,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout

View File

@ -10,7 +10,7 @@ public class OddsCalculator {
public void recalculate(List players, int spotsOpen, PlayerChooser chooser) { public void recalculate(List players, int spotsOpen, PlayerChooser chooser) {
if (log.isTraceEnabled()) log.trace("Recalculating odds.") log.trace("Recalculating odds.")
// reset computed player odds // reset computed player odds
odds = [:] odds = [:]
@ -38,6 +38,8 @@ public class OddsCalculator {
def oddsList = buildOdds([], players, spotsOpen, chooser) def oddsList = buildOdds([], players, spotsOpen, chooser)
if (log.isTraceEnabled()) log.trace(oddsList.toString())
/* The oddsMap is a condensed version of the oddsList, calculating /* The oddsMap is a condensed version of the oddsList, calculating
* the overall probability of each path:: * the overall probability of each path::
* *
@ -80,7 +82,7 @@ public class OddsCalculator {
odds[(player)] = playerOdds 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, protected List buildOdds(List chosenPath, List players, int spotsOpen,