From 5d632ace5d41f83cc268420ee8779d9fb4eb8e17 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 4 Apr 2015 14:15:29 +0200 Subject: Split NO_PEACH to DEBUG_PRINTS --- spellchecker/run.sh | 5 +++-- 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); } } -- cgit v1.2.1