commit 843df3747c85fec25f87129c830629fac8a19983
parent 8671f7e1f417bc7aa9c07bf6080007e141395422
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 8 Nov 2009 13:11:25 +1000
prefer java.util.logging over System.err
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/main/java/au/com/miskinhill/search/analysis/PerLanguageAnalyzerWrapper.java b/src/main/java/au/com/miskinhill/search/analysis/PerLanguageAnalyzerWrapper.java
@@ -3,6 +3,7 @@ package au.com.miskinhill.search.analysis;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
+import java.util.logging.Logger;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
@@ -22,6 +23,8 @@ import org.apache.lucene.analysis.TokenStream;
* whose language is given as "en-AU".
*/
public class PerLanguageAnalyzerWrapper extends Analyzer {
+
+ private static final Logger LOG = Logger.getLogger(PerLanguageAnalyzerWrapper.class.getName());
protected Trie<Analyzer> analyzers;
private List<Analyzer> analyzersList = new ArrayList<Analyzer>(); // easier than traversing the trie
@@ -45,7 +48,7 @@ public class PerLanguageAnalyzerWrapper extends Analyzer {
@Override
public TokenStream tokenStream(String fieldName, Reader reader) {
- System.err.println("WARNING: " + this + " using default analyzer");
+ LOG.warning("Using default analyzer");
return tokenStream("", fieldName, reader);
}
@@ -53,8 +56,7 @@ public class PerLanguageAnalyzerWrapper extends Analyzer {
if (language == null) language = "";
Analyzer a = analyzers.get(language);
if (a == analyzersList.get(0))
- System.err.println("WARNING: " + this +
- " using default analyzer for language " + language);
+ LOG.warning("Using default analyzer for language " + language);
return a.tokenStream(fieldName, reader);
}