Usage of logging-class

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@432 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
rramthun 20 years ago
parent af67c633d5
commit bf7d5d1310

@ -71,7 +71,7 @@ public class translator {
while(keys.hasMoreElements()){ while(keys.hasMoreElements()){
key = (String)keys.nextElement(); key = (String)keys.nextElement();
result = result.replaceAll(key, (String)translationList.get(key)); 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; return result;
} }

@ -117,7 +117,7 @@ public class wikiBoard {
public String guessAuthor(String ip) { public String guessAuthor(String ip) {
String author = (String) authors.get(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; return author;
} }
@ -146,7 +146,7 @@ public class wikiBoard {
else else
record.put("page", serverCodings.enhancedCoder.encodeBase64(page)); record.put("page", serverCodings.enhancedCoder.encodeBase64(page));
authors.put(ip, author); 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) { private entry(String key, Map record) {
@ -259,9 +259,9 @@ public class wikiBoard {
page.setAncestorDate(oldDate); page.setAncestorDate(oldDate);
oldEntry.setChild(page.subject()); oldEntry.setChild(page.subject());
// write the backup // write the backup
//System.out.println("key = " + page.key); //yacyCore.log.logDebug("key = " + page.key);
//System.out.println("oldDate = " + oldDate); //yacyCore.log.logDebug("oldDate = " + oldDate);
//System.out.println("record = " + oldEntry.record.toString()); //yacyCore.log.logDebug("record = " + oldEntry.record.toString());
bkpbase.set(page.key + dateString(oldDate), oldEntry.record); bkpbase.set(page.key + dateString(oldDate), oldEntry.record);
// write the new page // write the new page
datbase.set(page.key, page.record); datbase.set(page.key, page.record);

@ -96,7 +96,7 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen
} }
public void scrapeText(byte[] newtext) { 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); 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); 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) { 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("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("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(); 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() { public void print() {
System.out.println("TITLE :" + title); yacyCore.log.logInfo("TITLE :" + title);
System.out.println("HEADLINE:" + headline); yacyCore.log.logInfo("HEADLINE:" + headline);
System.out.println("ANCHORS :" + anchors.toString()); yacyCore.log.logInfo("ANCHORS :" + anchors.toString());
System.out.println("IMAGES :" + images.toString()); yacyCore.log.logInfo("IMAGES :" + images.toString());
System.out.println("TEXT :" + new String(text.getBytes())); yacyCore.log.logInfo("TEXT :" + new String(text.getBytes()));
} }
@ -194,7 +194,7 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen
try { try {
htmlFilterContentScraper scraper = new htmlFilterContentScraper(new URL("http://localhost")); htmlFilterContentScraper scraper = new htmlFilterContentScraper(new URL("http://localhost"));
scraper.scrapeText(test.getBytes()); scraper.scrapeText(test.getBytes());
System.out.println(new String(scraper.getText())); yacyCore.log.logInfo(new String(scraper.getText()));
} catch (MalformedURLException e) {} } catch (MalformedURLException e) {}
} }

@ -77,7 +77,7 @@ public class htmlFilterContentTransformer extends htmlFilterAbstractTransformer
} }
public void init(String initarg) { public void init(String initarg) {
//System.out.println("Transformer init: " + initarg); //yacyCore.log.logDebug("Transformer init: " + initarg);
if (bluelist == null) { if (bluelist == null) {
// here, the initarg is used to load a list of bluelisted words // here, the initarg is used to load a list of bluelisted words
bluelist = new Vector(); bluelist = new Vector();
@ -91,7 +91,7 @@ public class htmlFilterContentTransformer extends htmlFilterAbstractTransformer
r.close(); r.close();
} catch (Exception e) { } 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 htmlFilterAbstractTransformer
public byte[] transformText(byte[] text) { public byte[] transformText(byte[] text) {
if (hit(text)) { if (hit(text)) {
System.out.println("FILTERHIT: " + text); yacyCore.log.logInfo("FILTERHIT: " + text);
return genBlueLetters(text.length); return genBlueLetters(text.length);
} else } else
return text; return text;

@ -159,7 +159,7 @@ public final class htmlFilterOutputStream extends OutputStream {
} }
private byte[] filterTag(String tag, boolean opening, byte[] content, byte quotechar) { 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)); // debug
if (filterTag == null) { if (filterTag == null) {
// we are not collection tag text // we are not collection tag text
if (tag == null) { if (tag == null) {
@ -245,7 +245,7 @@ public final class htmlFilterOutputStream extends OutputStream {
private byte[] filterSentence(byte[] in, byte quotechar) { private byte[] filterSentence(byte[] in, byte quotechar) {
if (in.length == 0) return in; 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 structure // scan the string and parse structure
if ((in.length > 2) && (in[0] == lb)) { if ((in.length > 2) && (in[0] == lb)) {
// a tag // a tag
@ -290,7 +290,7 @@ public final class htmlFilterOutputStream extends OutputStream {
} }
private void write(byte b) throws IOException { private void write(byte b) throws IOException {
//System.out.print((char) b); //yacyCore.log.logDebug((char) b);
if ((binaryUnsuspect) && (binaryHint(b))) { if ((binaryUnsuspect) && (binaryHint(b))) {
binaryUnsuspect = false; binaryUnsuspect = false;
if (passbyIfBinarySuspect) finalize(); if (passbyIfBinarySuspect) finalize();
@ -423,7 +423,7 @@ public final class htmlFilterOutputStream extends OutputStream {
} }
public void write(byte b[], int off, int len) throws IOException { 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(); 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]); 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 > 31) return false;
if ((b == 8) || (b == 9) || (b == 10) || (b == 13)) return false; if ((b == 8) || (b == 9) || (b == 10) || (b == 13)) return false;
//return false; //return false;
System.out.println("BINARY HINT: " + (int) b); yacyCore.log.logInfo("BINARY HINT: " + (int) b);
return true; return true;
} }

@ -222,11 +222,11 @@ public class yacyCore {
/* /*
if (oldIPStamp.equals((String) seedDB.mySeed.get("IP", "127.0.0.1"))) 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()) if (seedCacheSizeStamp == seedDB.sizeConnected())
System.out.println("***DEBUG publishSeedList: sizeConnected is equal"); yacyCore.log.logDebug("***DEBUG publishSeedList: sizeConnected is equal");
if (canReachMyself()) if (canReachMyself())
System.out.println("***DEBUG publishSeedList: I can reach myself"); yacyCore.log.logDebug("***DEBUG publishSeedList: I can reach myself");
*/ */
if ( if (
@ -463,7 +463,7 @@ public class yacyCore {
if(ip.equals("")){ if(ip.equals("")){
ip = natLib.retrieveIP(DI604use, DI604pw, (switchboard.getConfig("yacyDebugMode", "false")=="false" ? false : true)); 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); seedDB.mySeed.put("IP", ip);
if (seedDB.mySeed.get("PeerType", "junior").equals("junior")) // ??????????????? if (seedDB.mySeed.get("PeerType", "junior").equals("junior")) // ???????????????
seedDB.mySeed.put("PeerType", "senior"); // to start bootstraping, we need to be recognised as "senior" peer seedDB.mySeed.put("PeerType", "senior"); // to start bootstraping, we need to be recognised as "senior" peer

@ -172,7 +172,7 @@ public class yacySearch extends Thread {
if (searchThreads[i].links() < 0) anyIdle = true; else c = c + searchThreads[i].links(); if (searchThreads[i].links() < 0) anyIdle = true; else c = c + searchThreads[i].links();
} }
if ((c >= count * 3) && ((System.currentTimeMillis() - start) > (waitingtime * 2 / 3))) { 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 break; // we have enough
} }
if (c >= count * 5) break; if (c >= count * 5) break;

Loading…
Cancel
Save