diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-04-04 14:15:29 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2015-04-04 14:15:29 +0200 |
commit | 5d632ace5d41f83cc268420ee8779d9fb4eb8e17 (patch) | |
tree | 547115917034a56027d2159dd0498da30249fea5 | |
parent | 9d7d38f1850680fadc8ce9f1d40106393135f7a9 (diff) | |
download | assignment4-5d632ace5d41f83cc268420ee8779d9fb4eb8e17.tar.gz |
Split NO_PEACH to DEBUG_PRINTS
-rwxr-xr-x | spellchecker/run.sh | 5 | ||||
-rw-r--r-- | spellchecker/src/SpellCorrector.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/spellchecker/run.sh b/spellchecker/run.sh index e2df2d4..2d02dd9 100755 --- a/spellchecker/run.sh +++ b/spellchecker/run.sh @@ -3,8 +3,9 @@ classpath="${CLASSPATH:+$CLASSPATH:}" classpath+=build/classes # Possible env vars: -#DEBUG_SCORE=1 # Enable debugging of the score -#NO_PEACH=1 # Print less debug information, use peach I/O formats +#DEBUG_PRINTS=1 # Enable debugging output to stderr +#DEBUG_SCORE=1 # Enable debugging of the score. Implies DEBUG_PRINTS=1 +#NO_PEACH=1 # Use peach I/O formats ant -q -S compile >&2 && NO_PEACH=1 \ diff --git a/spellchecker/src/SpellCorrector.java b/spellchecker/src/SpellCorrector.java index 39ded2e..4bc3fe8 100644 --- a/spellchecker/src/SpellCorrector.java +++ b/spellchecker/src/SpellCorrector.java @@ -66,8 +66,8 @@ public class SpellCorrector { } private void debugPrint(String str) { - // print debugging information if NO_PEACH is set. - if (System.getenv("NO_PEACH") != null) { + // print debugging information if DEBUG_PRINTS or DEBUG_SCORE is set. + if (DEBUG_SCORE || System.getenv("DEBUG_PRINTS") != null) { System.err.println(str); } } |