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()){
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;
}

@ -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 {
else
record.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 page
datbase.set(page.key, page.record);

@ -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 implemen
try {
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) {}
}

@ -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 words
bluelist = new Vector();
@ -91,7 +91,7 @@ public class htmlFilterContentTransformer extends htmlFilterAbstractTransformer
r.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 htmlFilterAbstractTransformer
public byte[] transformText(byte[] text) {
if (hit(text)) {
System.out.println("FILTERHIT: " + text);
yacyCore.log.logInfo("FILTERHIT: " + text);
return genBlueLetters(text.length);
} else
return text;

@ -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)); // debug
if (filterTag == null) {
// we are not collection tag text
if (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 structure
if ((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;
}

@ -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" peer

@ -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;

Loading…
Cancel
Save