Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Usage of logging-class
rramthunbf7d5d1310bb
diff --git a/source/de/anomic/data/translator.java b/source/de/anomic/data/translator.javaindex 5952b1593..866c810d7 100644--- a/source/de/anomic/data/translator.java+++ b/source/de/anomic/data/translator.java@@ -71,7 +71,7 @@ public class translator {while(keys.hasMoreElements()){key = (String)keys.nextElement();result = result.replaceAll(key, (String)translationList.get(key));- //System.out.println("Replaced \""+key+"\" by \""+translationList.getProperty(key)+"\""); //DEBUG+ //yacyCore.log.logDebug("Replaced \""+key+"\" by \""+translationList.getProperty(key)+"\""); //DEBUG}return result;}diff --git a/source/de/anomic/data/wikiBoard.java b/source/de/anomic/data/wikiBoard.javaindex 75aa827ee..6162b38d2 100644--- a/source/de/anomic/data/wikiBoard.java+++ b/source/de/anomic/data/wikiBoard.java@@ -117,7 +117,7 @@ public class wikiBoard {public String guessAuthor(String ip) {String author = (String) authors.get(ip);- //System.out.println("DEBUG: guessing author for ip = " + ip + " is '" + author + "', authors = " + authors.toString());+ //yacyCore.log.logDebug("DEBUG: guessing author for ip = " + ip + " is '" + author + "', authors = " + authors.toString());return author;}@@ -146,7 +146,7 @@ public class wikiBoard {elserecord.put("page", serverCodings.enhancedCoder.encodeBase64(page));authors.put(ip, author);- //System.out.println("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString());+ //yacyCore.log.logDebug("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString());}private entry(String key, Map record) {@@ -259,9 +259,9 @@ public class wikiBoard {page.setAncestorDate(oldDate);oldEntry.setChild(page.subject());// write the backup- //System.out.println("key = " + page.key);- //System.out.println("oldDate = " + oldDate);- //System.out.println("record = " + oldEntry.record.toString());+ //yacyCore.log.logDebug("key = " + page.key);+ //yacyCore.log.logDebug("oldDate = " + oldDate);+ //yacyCore.log.logDebug("record = " + oldEntry.record.toString());bkpbase.set(page.key + dateString(oldDate), oldEntry.record);// write the new pagedatbase.set(page.key, page.record);diff --git a/source/de/anomic/htmlFilter/htmlFilterContentScraper.java b/source/de/anomic/htmlFilter/htmlFilterContentScraper.javaindex 263645a84..dc913b36a 100644--- a/source/de/anomic/htmlFilter/htmlFilterContentScraper.java+++ b/source/de/anomic/htmlFilter/htmlFilterContentScraper.java@@ -96,7 +96,7 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen}public void scrapeText(byte[] newtext) {- //System.out.println("SCRAPE: " + new String(newtext));+ //yacyCore.log.logDebug("SCRAPE: " + new String(newtext));if ((text.length() != 0) && (text.byteAt(text.length() - 1) != 32)) text.append(32);text.append(super.stripAll(new serverByteBuffer(newtext, newtext.length + 1)).trim()).append(32);}@@ -130,7 +130,7 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen}public void scrapeTag1(String tagname, Properties tagopts, byte[] text) {- //System.out.println("ScrapeTag1: tagname=" + tagname + ", opts=" + tagopts.toString() + ", text=" + new String(text));+ //yacyCore.log.logDebug("ScrapeTag1: tagname=" + tagname + ", opts=" + tagopts.toString() + ", text=" + new String(text));if ((tagname.equalsIgnoreCase("a")) && (text.length < 2048)) anchors.put(absolutePath(tagopts.getProperty("href", "")), super.stripAll(new serverByteBuffer(text)).trim().toString());if ((tagname.equalsIgnoreCase("h1")) && (text.length < 1024)) headline = super.stripAll(new serverByteBuffer(text)).toString();if ((tagname.equalsIgnoreCase("title")) && (text.length < 1024)) title = super.stripAll(new serverByteBuffer(text)).toString();@@ -181,11 +181,11 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen}public void print() {- System.out.println("TITLE :" + title);- System.out.println("HEADLINE:" + headline);- System.out.println("ANCHORS :" + anchors.toString());- System.out.println("IMAGES :" + images.toString());- System.out.println("TEXT :" + new String(text.getBytes()));+ yacyCore.log.logInfo("TITLE :" + title);+ yacyCore.log.logInfo("HEADLINE:" + headline);+ yacyCore.log.logInfo("ANCHORS :" + anchors.toString());+ yacyCore.log.logInfo("IMAGES :" + images.toString());+ yacyCore.log.logInfo("TEXT :" + new String(text.getBytes()));}@@ -194,7 +194,7 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implementry {htmlFilterContentScraper scraper = new htmlFilterContentScraper(new URL("http://localhost"));scraper.scrapeText(test.getBytes());- System.out.println(new String(scraper.getText()));+ yacyCore.log.logInfo(new String(scraper.getText()));} catch (MalformedURLException e) {}}diff --git a/source/de/anomic/htmlFilter/htmlFilterContentTransformer.java b/source/de/anomic/htmlFilter/htmlFilterContentTransformer.javaindex 563dc1170..5c5ee845a 100644--- a/source/de/anomic/htmlFilter/htmlFilterContentTransformer.java+++ b/source/de/anomic/htmlFilter/htmlFilterContentTransformer.java@@ -77,7 +77,7 @@ public class htmlFilterContentTransformer extends htmlFilterAbstractTransformer}public void init(String initarg) {- //System.out.println("Transformer init: " + initarg);+ //yacyCore.log.logDebug("Transformer init: " + initarg);if (bluelist == null) {// here, the initarg is used to load a list of bluelisted wordsbluelist = new Vector();@@ -91,7 +91,7 @@ public class htmlFilterContentTransformer extends htmlFilterAbstractTransformerr.close();} catch (Exception e) {}- //if (bluelist.size() == 0) System.out.println("BLUELIST is empty");+ //if (bluelist.size() == 0) yacyCore.log.logInfo("BLUELIST is empty");}}@@ -117,7 +117,7 @@ public class htmlFilterContentTransformer extends htmlFilterAbstractTransformerpublic byte[] transformText(byte[] text) {if (hit(text)) {- System.out.println("FILTERHIT: " + text);+ yacyCore.log.logInfo("FILTERHIT: " + text);return genBlueLetters(text.length);} elsereturn text;diff --git a/source/de/anomic/htmlFilter/htmlFilterOutputStream.java b/source/de/anomic/htmlFilter/htmlFilterOutputStream.javaindex df6369973..d8881a412 100644--- a/source/de/anomic/htmlFilter/htmlFilterOutputStream.java+++ b/source/de/anomic/htmlFilter/htmlFilterOutputStream.java@@ -159,7 +159,7 @@ public final class htmlFilterOutputStream extends OutputStream {}private byte[] filterTag(String tag, boolean opening, byte[] content, byte quotechar) {- //System.out.println("FILTER1: filterTag=" + ((filterTag == null) ? "null" : filterTag) + ", tag=" + tag + ", opening=" + ((opening) ? "true" : "false") + ", content=" + new String(content)); // debug+ //yacyCore.log.logDebug("FILTER1: filterTag=" + ((filterTag == null) ? "null" : filterTag) + ", tag=" + tag + ", opening=" + ((opening) ? "true" : "false") + ", content=" + new String(content)); // debugif (filterTag == null) {// we are not collection tag textif (tag == null) {@@ -245,7 +245,7 @@ public final class htmlFilterOutputStream extends OutputStream {private byte[] filterSentence(byte[] in, byte quotechar) {if (in.length == 0) return in;- //System.out.println("FILTER0: " + new String(in)); // debug+ //yacyCore.log.logDebug("FILTER0: " + new String(in)); // debug// scan the string and parse structureif ((in.length > 2) && (in[0] == lb)) {// a tag@@ -290,7 +290,7 @@ public final class htmlFilterOutputStream extends OutputStream {}private void write(byte b) throws IOException {- //System.out.print((char) b);+ //yacyCore.log.logDebug((char) b);if ((binaryUnsuspect) && (binaryHint(b))) {binaryUnsuspect = false;if (passbyIfBinarySuspect) finalize();@@ -423,7 +423,7 @@ public final class htmlFilterOutputStream extends OutputStream {}public void write(byte b[], int off, int len) throws IOException {- //System.out.print(new String(b, off, len));+ //yacyCore.log.logDebug(new String(b, off, len));if ((off | len | (b.length - (len + off)) | (off + len)) < 0) throw new IndexOutOfBoundsException();for (int i = off ; i < (len - off) ; i++) this.write(b[i]);}@@ -469,7 +469,7 @@ public final class htmlFilterOutputStream extends OutputStream {if (b > 31) return false;if ((b == 8) || (b == 9) || (b == 10) || (b == 13)) return false;//return false;- System.out.println("BINARY HINT: " + (int) b);+ yacyCore.log.logInfo("BINARY HINT: " + (int) b);return true;}diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.javaindex fab9b6dd2..a30e3779d 100644--- a/source/de/anomic/yacy/yacyCore.java+++ b/source/de/anomic/yacy/yacyCore.java@@ -222,11 +222,11 @@ public class yacyCore {/*if (oldIPStamp.equals((String) seedDB.mySeed.get("IP", "127.0.0.1")))- System.out.println("***DEBUG publishSeedList: oldIP is equal");+ yacyCore.log.logDebug("***DEBUG publishSeedList: oldIP is equal");if (seedCacheSizeStamp == seedDB.sizeConnected())- System.out.println("***DEBUG publishSeedList: sizeConnected is equal");+ yacyCore.log.logDebug("***DEBUG publishSeedList: sizeConnected is equal");if (canReachMyself())- System.out.println("***DEBUG publishSeedList: I can reach myself");+ yacyCore.log.logDebug("***DEBUG publishSeedList: I can reach myself");*/if (@@ -463,7 +463,7 @@ public class yacyCore {if(ip.equals("")){ip = natLib.retrieveIP(DI604use, DI604pw, (switchboard.getConfig("yacyDebugMode", "false")=="false" ? false : true));}- //System.out.println("DEBUG: new IP=" + ip);+ //yacyCore.log.logDebug("DEBUG: new IP=" + ip);seedDB.mySeed.put("IP", ip);if (seedDB.mySeed.get("PeerType", "junior").equals("junior")) // ???????????????seedDB.mySeed.put("PeerType", "senior"); // to start bootstraping, we need to be recognised as "senior" peerdiff --git a/source/de/anomic/yacy/yacySearch.java b/source/de/anomic/yacy/yacySearch.javaindex 5d8a07713..8f6046b89 100644--- a/source/de/anomic/yacy/yacySearch.java+++ b/source/de/anomic/yacy/yacySearch.java@@ -172,7 +172,7 @@ public class yacySearch extends Thread {if (searchThreads[i].links() < 0) anyIdle = true; else c = c + searchThreads[i].links();}if ((c >= count * 3) && ((System.currentTimeMillis() - start) > (waitingtime * 2 / 3))) {- System.out.println("DEBUG yacySearch: c=" + c + ", count=" + count + ", waitingtime=" + waitingtime);+ yacyCore.log.logDebug("DEBUG yacySearch: c=" + c + ", count=" + count + ", waitingtime=" + waitingtime);break; // we have enough}if (c >= count * 5) break;