Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- refactoring of log to ConcurrentLog: jdk-based logger tend to block at java.util.logging.Logger.log(Logger.java:476) in concurrent environments. This makes logging a main performance issue. To overcome this problem, this is a add-on to jdk logging to put log entries on a concurrent message queue and log the messages one by one using a separate process. - FTPClient uses the concurrent logging instead of the log4j logger

Michael Peter Christen5878c1d59992
diff --git a/htroot/BlacklistCleaner_p.java b/htroot/BlacklistCleaner_p.java
index bd1b72bb6..eea6929e7 100644
--- a/htroot/BlacklistCleaner_p.java
+++ b/htroot/BlacklistCleaner_p.java
@@ -45,8 +45,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.ListManager;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.Blacklist;
import net.yacy.repository.Blacklist.BlacklistError;
@@ -303,7 +303,7 @@ public class BlacklistCleaner_p {
try {
Switchboard.urlBlacklist.remove(supportedBlacklistType, host, path);
} catch (final RuntimeException e) {
- Log.logSevere("BLACKLIST-CLEANER", e.getMessage() + ": " + host + "/" + path);
+ ConcurrentLog.severe("BLACKLIST-CLEANER", e.getMessage() + ": " + host + "/" + path);
}
}
}
@@ -355,7 +355,7 @@ public class BlacklistCleaner_p {
}
pw.close();
} catch (final IOException e) {
- Log.logSevere("BLACKLIST-CLEANER", "error on writing altered entries to blacklist", e);
+ ConcurrentLog.severe("BLACKLIST-CLEANER", "error on writing altered entries to blacklist", e);
}
return newEntry.length;
}
diff --git a/htroot/Blacklist_p.java b/htroot/Blacklist_p.java
index 1e2695436..d7261127e 100644
--- a/htroot/Blacklist_p.java
+++ b/htroot/Blacklist_p.java
@@ -37,10 +37,10 @@ import java.util.List;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.ListManager;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.Blacklist;
import net.yacy.repository.Blacklist.BlacklistType;
@@ -181,7 +181,7 @@ public class Blacklist_p {
final File blackListFile = new File(ListManager.listsPath, blacklistToUse);
if(!blackListFile.delete()) {
- Log.logWarning("Blacklist", "file "+ blackListFile +" could not be deleted!");
+ ConcurrentLog.warn("Blacklist", "file "+ blackListFile +" could not be deleted!");
}
for (final BlacklistType supportedBlacklistType : BlacklistType.values()) {
@@ -590,7 +590,7 @@ public class Blacklist_p {
// ignore empty entries
if(newEntry == null || newEntry.isEmpty()) {
- Log.logWarning("Blacklist", "skipped adding an empty entry");
+ ConcurrentLog.warn("Blacklist", "skipped adding an empty entry");
return "";
}
diff --git a/htroot/BlogComments.java b/htroot/BlogComments.java
index 2f88a1c80..e8650df5b 100644
--- a/htroot/BlogComments.java
+++ b/htroot/BlogComments.java
@@ -39,12 +39,12 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.BlogBoard;
import net.yacy.data.BlogBoardComments;
import net.yacy.data.MessageBoard;
import net.yacy.data.UserDB;
import net.yacy.data.BlogBoard.BlogEntry;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.Network;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -147,7 +147,7 @@ public class BlogComments {
try {
Files.copy(notifierSource, notifierDest);
} catch (final IOException e) {
- Log.logSevere("MESSAGE", "NEW MESSAGE ARRIVED! (error: " + e.getMessage() + ")");
+ ConcurrentLog.severe("MESSAGE", "NEW MESSAGE ARRIVED! (error: " + e.getMessage() + ")");
}
}
@@ -320,7 +320,7 @@ public class BlogComments {
email.print(new String(emailTxt));
email.close();
} catch (final Exception e) {
- Network.log.logWarning("message: message forwarding via email failed. ",e);
+ Network.log.warn("message: message forwarding via email failed. ",e);
}
}
}
diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.java
index 7c942a88a..1233deb77 100644
--- a/htroot/Bookmarks.java
+++ b/htroot/Bookmarks.java
@@ -44,6 +44,7 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.BookmarkHelper;
import net.yacy.data.BookmarksDB;
import net.yacy.data.ListManager;
@@ -54,7 +55,6 @@ import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.NewsPool;
import net.yacy.search.Switchboard;
import net.yacy.search.snippet.TextSnippet;
@@ -212,7 +212,7 @@ public class Bookmarks {
prop.putHTML("mode_path","");
prop.put("mode_public", "0");
prop.put("mode_feed", "0"); //TODO: check if it IS a feed
- } catch (final IOException e) {Log.logException(e);} catch (final Parser.Failure e) {Log.logException(e);}
+ } catch (final IOException e) {ConcurrentLog.logException(e);} catch (final Parser.Failure e) {ConcurrentLog.logException(e);}
} else {
// get from the bookmark database
prop.put("mode_edit", "1"); // edit mode
@@ -243,14 +243,14 @@ public class Bookmarks {
tags="unsorted";
}
- Log.logInfo("BOOKMARKS", "Trying to import bookmarks from HTML-file");
+ ConcurrentLog.info("BOOKMARKS", "Trying to import bookmarks from HTML-file");
try {
final File file = new File(post.get("htmlfile"));
BookmarkHelper.importFromBookmarks(sb.bookmarksDB, new DigestURI(file), post.get("htmlfile$file"), tags, isPublic);
} catch (final MalformedURLException e) {}
- Log.logInfo("BOOKMARKS", "success!!");
+ ConcurrentLog.info("BOOKMARKS", "success!!");
} else if (post.containsKey("xmlfile")) {
diff --git a/htroot/CacheResource_p.java b/htroot/CacheResource_p.java
index 9fcb0c574..f56780d06 100644
--- a/htroot/CacheResource_p.java
+++ b/htroot/CacheResource_p.java
@@ -27,10 +27,10 @@ import java.net.MalformedURLException;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.document.ImageParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.servletProperties;
@@ -48,7 +48,7 @@ public class CacheResource_p {
try {
url = new DigestURI(u);
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return prop;
}
diff --git a/htroot/ConfigAccounts_p.java b/htroot/ConfigAccounts_p.java
index 8e907f8c8..b821a7151 100644
--- a/htroot/ConfigAccounts_p.java
+++ b/htroot/ConfigAccounts_p.java
@@ -38,9 +38,9 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.UserDB.AccessRight;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@@ -224,7 +224,7 @@ public class ConfigAccounts_p {
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
diff --git a/htroot/ConfigHeuristics_p.java b/htroot/ConfigHeuristics_p.java
index c96c005ce..b7da94769 100644
--- a/htroot/ConfigHeuristics_p.java
+++ b/htroot/ConfigHeuristics_p.java
@@ -29,8 +29,8 @@ import com.google.common.io.Files;
import java.io.File;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.Configuration;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import java.io.IOException;
@@ -187,7 +187,7 @@ public class ConfigHeuristics_p {
}
prop.put("osdcfg", c);
} catch (IOException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
prop.put("osdcfg", 0);
}
prop.putHTML("osderrmsg",osderrmsg);
@@ -234,7 +234,7 @@ public class ConfigHeuristics_p {
}
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// re-read config (and create/update work table)
diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java
index 21674782d..561ada482 100644
--- a/htroot/ConfigPortal.java
+++ b/htroot/ConfigPortal.java
@@ -31,9 +31,9 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@@ -109,17 +109,17 @@ public class ConfigPortal {
fis = new FileInputStream(new File(sb.appPath, "defaults/yacy.init"));
config.load(fis);
} catch (final FileNotFoundException e) {
- Log.logSevere(mes, "could not find configuration file.");
+ ConcurrentLog.severe(mes, "could not find configuration file.");
return prop;
} catch (final IOException e) {
- Log.logSevere(mes, "could not read configuration file.");
+ ConcurrentLog.severe(mes, "could not read configuration file.");
return prop;
} finally {
if (fis != null) {
try {
fis.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/htroot/ConfigSearchPage_p.java b/htroot/ConfigSearchPage_p.java
index 9f4ef6f7d..108845e35 100644
--- a/htroot/ConfigSearchPage_p.java
+++ b/htroot/ConfigSearchPage_p.java
@@ -33,8 +33,8 @@ import java.sql.Date;
import java.util.Properties;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@@ -99,17 +99,17 @@ public class ConfigSearchPage_p {
fis = new FileInputStream(new File(sb.appPath, "defaults/yacy.init"));
config.load(fis);
} catch (final FileNotFoundException e) {
- Log.logSevere(mes, "could not find configuration file.");
+ ConcurrentLog.severe(mes, "could not find configuration file.");
return prop;
} catch (final IOException e) {
- Log.logSevere(mes, "could not read configuration file.");
+ ConcurrentLog.severe(mes, "could not read configuration file.");
return prop;
} finally {
if (fis != null) {
try {
fis.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/htroot/ConfigUpdate_p.java b/htroot/ConfigUpdate_p.java
index fc4532e8d..8f156ac96 100644
--- a/htroot/ConfigUpdate_p.java
+++ b/htroot/ConfigUpdate_p.java
@@ -33,8 +33,8 @@ import java.util.Set;
import java.util.TreeSet;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.OS;
import net.yacy.peers.operation.yacyBuildProperties;
@@ -97,7 +97,7 @@ public class ConfigUpdate_p {
versionToDownload.downloadRelease();
} catch (final IOException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -115,10 +115,10 @@ public class ConfigUpdate_p {
FileUtils.deletedelete(new File(sb.releasePath, release));
FileUtils.deletedelete(new File(sb.releasePath, release + ".sig"));
} else {
- sb.getLog().logSevere("AUTO-UPDATE: could not delete " + release + ": file not in release directory.");
+ sb.getLog().severe("AUTO-UPDATE: could not delete " + release + ": file not in release directory.");
}
} catch (final NullPointerException e) {
- sb.getLog().logSevere("AUTO-UPDATE: could not delete release " + release + ": " + e.getMessage());
+ sb.getLog().severe("AUTO-UPDATE: could not delete release " + release + ": " + e.getMessage());
}
}
}
@@ -129,20 +129,20 @@ public class ConfigUpdate_p {
prop.put("candeploy_autoUpdate", "2"); // no more recent release found
} else {
// there is a version that is more recent. Load it and re-start with it
- sb.getLog().logInfo("AUTO-UPDATE: downloading more recent release " + updateVersion.getUrl());
+ sb.getLog().info("AUTO-UPDATE: downloading more recent release " + updateVersion.getUrl());
final File downloaded = updateVersion.downloadRelease();
prop.putHTML("candeploy_autoUpdate_downloadedRelease", updateVersion.getName());
final boolean devenvironment = new File(sb.getAppPath(), ".git").exists();
if (devenvironment) {
- sb.getLog().logInfo("AUTO-UPDATE: omitting update because this is a development environment");
+ sb.getLog().info("AUTO-UPDATE: omitting update because this is a development environment");
prop.put("candeploy_autoUpdate", "3");
} else if ((downloaded == null) || (!downloaded.exists()) || (downloaded.length() == 0)) {
- sb.getLog().logInfo("AUTO-UPDATE: omitting update because download failed (file cannot be found, is too small or signature was bad)");
+ sb.getLog().info("AUTO-UPDATE: omitting update because download failed (file cannot be found, is too small or signature was bad)");
prop.put("candeploy_autoUpdate", "4");
} else {
yacyRelease.deployRelease(downloaded);
sb.terminate(10, "manual release update to " + downloaded.getName());
- sb.getLog().logInfo("AUTO-UPDATE: deploy and restart initiated");
+ sb.getLog().info("AUTO-UPDATE: deploy and restart initiated");
prop.put("candeploy_autoUpdate", "1");
}
}
diff --git a/htroot/Connections_p.java b/htroot/Connections_p.java
index 889fa0d8e..efcf017df 100644
--- a/htroot/Connections_p.java
+++ b/htroot/Connections_p.java
@@ -37,7 +37,7 @@ import java.util.Set;
import net.yacy.cora.protocol.ConnectionInfo;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.workflow.WorkflowThread;
import net.yacy.peers.PeerActions;
import net.yacy.peers.Seed;
@@ -111,7 +111,7 @@ public final class Connections_p {
prop.put("list_" + idx + "_serverSessionID",URLEncoder.encode(s.getName(),"UTF8"));
} catch (final UnsupportedEncodingException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.putHTML("list_" + idx + "_sessionName", s.getName());
prop.put("list_" + idx + "_proto", prot);
diff --git a/htroot/ContentIntegrationPHPBB3_p.java b/htroot/ContentIntegrationPHPBB3_p.java
index 898943c1d..053fe4c56 100644
--- a/htroot/ContentIntegrationPHPBB3_p.java
+++ b/htroot/ContentIntegrationPHPBB3_p.java
@@ -26,10 +26,10 @@ import java.io.File;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.content.dao.Dao;
import net.yacy.document.content.dao.ImportDump;
import net.yacy.document.content.dao.PhpBB3Dao;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -87,7 +87,7 @@ public class ContentIntegrationPHPBB3_p {
prop.putHTML("check_last", db.latest().toString());
db.close();
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("check", 2);
prop.put("check_error", e.getMessage());
}
@@ -111,7 +111,7 @@ public class ContentIntegrationPHPBB3_p {
prop.put("export_files", files);
db.close();
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("export", 2);
prop.put("export_error", e.getMessage());
}
@@ -136,7 +136,7 @@ public class ContentIntegrationPHPBB3_p {
prop.put("import", 1);
importer.close();
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("import", 2);
prop.put("import_error", e.getMessage());
}
diff --git a/htroot/CrawlCheck_p.java b/htroot/CrawlCheck_p.java
index 7e89a066f..12e9b10e3 100644
--- a/htroot/CrawlCheck_p.java
+++ b/htroot/CrawlCheck_p.java
@@ -27,12 +27,12 @@ import java.util.regex.Pattern;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.crawler.retrieval.Request;
import net.yacy.crawler.retrieval.Response;
import net.yacy.crawler.robots.RobotsTxtEntry;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -65,7 +65,7 @@ public class CrawlCheck_p {
DigestURI crawlingStartURL = new DigestURI(crawlingStart);
rootURLs.add(crawlingStartURL);
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/htroot/CrawlProfileEditor_p.java b/htroot/CrawlProfileEditor_p.java
index 1d4d19c87..577db4b33 100644
--- a/htroot/CrawlProfileEditor_p.java
+++ b/htroot/CrawlProfileEditor_p.java
@@ -31,10 +31,10 @@ import java.util.Map;
import java.util.TreeMap;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.CrawlSwitchboard;
import net.yacy.crawler.data.CrawlProfile;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -107,7 +107,7 @@ public class CrawlProfileEditor_p {
sb.crawler.removeActive(handle.getBytes());
sb.crawlQueues.noticeURL.removeByProfileHandle(handle, 10000);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (post.containsKey("delete")) {
// deletion of a terminated crawl profile
@@ -159,7 +159,7 @@ public class CrawlProfileEditor_p {
}
}
} catch (final Exception ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
prop.put("error", "1");
prop.putHTML("error_message", ex.getMessage());
}
diff --git a/htroot/CrawlResults.java b/htroot/CrawlResults.java
index c41e6be8f..1aa7d95d8 100644
--- a/htroot/CrawlResults.java
+++ b/htroot/CrawlResults.java
@@ -34,11 +34,11 @@ import java.util.Map;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.crawler.data.ResultURLs.EventOrigin;
import net.yacy.crawler.data.ResultURLs.InitExecEntry;
import net.yacy.kelondro.data.meta.URIMetadataNode;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.Seed;
import net.yacy.search.Switchboard;
import net.yacy.search.schema.CollectionSchema;
@@ -184,7 +184,7 @@ public class CrawlResults {
try {
urle = sb.index.fulltext().getMetadata(UTF8.getBytes(entry.getKey()));
if (urle == null) {
- Log.logWarning("PLASMA", "CrawlResults: URL not in index with url hash " + entry.getKey());
+ ConcurrentLog.warn("PLASMA", "CrawlResults: URL not in index with url hash " + entry.getKey());
urlstr = null;
urltxt = null;
continue;
@@ -271,7 +271,7 @@ public class CrawlResults {
dark = !dark;
cnt++;
} catch (final Exception e) {
- Log.logSevere("PLASMA", "genTableProps", e);
+ ConcurrentLog.severe("PLASMA", "genTableProps", e);
}
}
prop.put("table_indexed", cnt);
diff --git a/htroot/CrawlStartScanner_p.java b/htroot/CrawlStartScanner_p.java
index 22a15b001..80296e8df 100644
--- a/htroot/CrawlStartScanner_p.java
+++ b/htroot/CrawlStartScanner_p.java
@@ -38,9 +38,9 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.Scanner;
import net.yacy.cora.protocol.Scanner.Access;
import net.yacy.cora.sorting.ReversibleScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.query.SearchEventCache;
@@ -201,7 +201,7 @@ public class CrawlStartScanner_p
uu = u.url();
pkmap.put(uu.hash(), uu);
} catch ( final MalformedURLException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
// search for crawl start requests in this mapping
@@ -266,7 +266,7 @@ public class CrawlStartScanner_p
u.hash());
}
} catch ( final MalformedURLException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} catch ( final ConcurrentModificationException e ) {
diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.java
index 3c368a95a..0f7138ffc 100644
--- a/htroot/Crawler_p.java
+++ b/htroot/Crawler_p.java
@@ -39,6 +39,7 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.CrawlSwitchboard;
import net.yacy.crawler.data.CrawlProfile;
@@ -52,7 +53,6 @@ import net.yacy.document.parser.html.ContentScraper;
import net.yacy.document.parser.html.TransformerWriter;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.peers.NewsPool;
import net.yacy.repository.Blacklist.BlacklistType;
@@ -96,7 +96,7 @@ public class Crawler_p {
if (post != null) {
String c = post.toString();
- if (c.length() < 1000) Log.logInfo("Crawl Start", c);
+ if (c.length() < 1000) ConcurrentLog.info("Crawl Start", c);
}
if (post != null && post.containsKey("continue")) {
@@ -132,7 +132,7 @@ public class Crawler_p {
sb.crawler.removeActive(handle.getBytes());
sb.crawlQueues.noticeURL.removeByProfileHandle(handle, 10000);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (post != null && post.containsKey("crawlingstart")) {
@@ -189,7 +189,7 @@ public class Crawler_p {
if (crawlingStartURL != null && (crawlingStartURL.isFile() || crawlingStartURL.isSMB())) storeHTCache = false;
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
crawlName = crawlingFile.getName();
@@ -294,7 +294,7 @@ public class Crawler_p {
newRootURLs.add(u);
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
rootURLs = newRootURLs;
@@ -319,7 +319,7 @@ public class Crawler_p {
String basepath = u.toNormalform(true);
if (!basepath.endsWith("/")) {int p = basepath.lastIndexOf("/"); if (p > 0) basepath = basepath.substring(0, p + 1);}
int count = sb.index.fulltext().remove(basepath, deleteageDate);
- if (count > 0) Log.logInfo("Crawler_p", "deleted " + count + " documents for host " + u.getHost());
+ if (count > 0) ConcurrentLog.info("Crawler_p", "deleted " + count + " documents for host " + u.getHost());
}
}
}
@@ -390,7 +390,7 @@ public class Crawler_p {
for (byte[] hosthash: hosthashes) {
try {
sb.index.fulltext().getDefaultConnector().deleteByQuery(CollectionSchema.host_id_s.getSolrFieldName() + ":\"" + ASCII.String(hosthash) + "\" AND " + CollectionSchema.failreason_s.getSolrFieldName() + ":[* TO *]");
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
}
sb.index.fulltext().commit(true);
@@ -472,7 +472,7 @@ public class Crawler_p {
prop.put("info", "6");//Error with url
prop.putHTML("info_crawlingStart", sitemapURLStr);
prop.putHTML("info_error", e.getMessage());
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else if ("file".equals(crawlingMode)) {
if (post.containsKey("crawlingFile")) {
@@ -510,7 +510,7 @@ public class Crawler_p {
prop.put("info", "7"); // Error with file
prop.putHTML("info_crawlingStart", crawlingFileName);
prop.putHTML("info_error", e.getMessage());
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
sb.continueCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL);
}
diff --git a/htroot/DictionaryLoader_p.java b/htroot/DictionaryLoader_p.java
index 230d97648..0c555e114 100644
--- a/htroot/DictionaryLoader_p.java
+++ b/htroot/DictionaryLoader_p.java
@@ -26,11 +26,11 @@ import net.yacy.cora.geo.GeonamesLocation;
import net.yacy.cora.geo.OpenGeoDBLocation;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.crawler.retrieval.Response;
import net.yacy.document.LibraryProvider;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -75,11 +75,11 @@ public class DictionaryLoader_p {
prop.put("geon0Status", LibraryProvider.Dictionary.GEON0.file().exists() ? 1 : 0);
prop.put("geon0ActionLoaded", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geon0ActionLoaded", 2);
prop.put("geon0ActionLoaded_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geon0ActionLoaded", 2);
prop.put("geon0ActionLoaded_error", e.getMessage());
}
@@ -117,11 +117,11 @@ public class DictionaryLoader_p {
prop.put("geon1Status", LibraryProvider.Dictionary.GEON1.file().exists() ? 1 : 0);
prop.put("geon1ActionLoaded", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geon1ActionLoaded", 2);
prop.put("geon1ActionLoaded_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geon1ActionLoaded", 2);
prop.put("geon1ActionLoaded_error", e.getMessage());
}
@@ -159,11 +159,11 @@ public class DictionaryLoader_p {
prop.put("geon2Status", LibraryProvider.Dictionary.GEON2.file().exists() ? 1 : 0);
prop.put("geon2ActionLoaded", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geon2ActionLoaded", 2);
prop.put("geon2ActionLoaded_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geon2ActionLoaded", 2);
prop.put("geon2ActionLoaded_error", e.getMessage());
}
@@ -202,11 +202,11 @@ public class DictionaryLoader_p {
prop.put("geo1Status", LibraryProvider.Dictionary.GEODB1.file().exists() ? 1 : 0);
prop.put("geo1ActionLoaded", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geo1ActionLoaded", 2);
prop.put("geo1ActionLoaded_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("geo1ActionLoaded", 2);
prop.put("geo1ActionLoaded_error", e.getMessage());
}
@@ -244,11 +244,11 @@ public class DictionaryLoader_p {
prop.put("drw0Status", LibraryProvider.Dictionary.DRW0.file().exists() ? 1 : 0);
prop.put("drw0ActionLoaded", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("drw0ActionLoaded", 2);
prop.put("drw0ActionLoaded_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("drw0ActionLoaded", 2);
prop.put("drw0ActionLoaded_error", e.getMessage());
}
@@ -287,11 +287,11 @@ public class DictionaryLoader_p {
prop.put("pnd0Status", LibraryProvider.Dictionary.PND0.file().exists() ? 1 : 0);
prop.put("pnd0ActionLoaded", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("pnd0ActionLoaded", 2);
prop.put("pnd0ActionLoaded_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("pnd0ActionLoaded", 2);
prop.put("pnd0ActionLoaded_error", e.getMessage());
}
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index bd3e5a3e1..40c816500 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -42,12 +42,12 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.HarvestProcess;
import net.yacy.crawler.data.NoticedURL.StackType;
import net.yacy.crawler.retrieval.Request;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.graphics.WebStructureGraph.StructureEntry;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Fulltext;
@@ -151,15 +151,15 @@ public class HostBrowser {
try {
fulltext.getDefaultConnector().deleteByQuery("-" + CollectionSchema.httpstatus_i.getSolrFieldName() + ":200 AND "
+ CollectionSchema.httpstatus_i.getSolrFieldName() + ":[* TO *]"); // make sure field exists
- Log.logInfo ("HostBrowser:", "delete documents with httpstatus_i <> 200");
+ ConcurrentLog.info ("HostBrowser:", "delete documents with httpstatus_i <> 200");
fulltext.getDefaultConnector().deleteByQuery(CollectionSchema.failtype_s.getSolrFieldName() + ":\"" + FailType.fail.name() + "\"" );
- Log.logInfo ("HostBrowser:", "delete documents with failtype_s = fail");
+ ConcurrentLog.info ("HostBrowser:", "delete documents with failtype_s = fail");
fulltext.getDefaultConnector().deleteByQuery(CollectionSchema.failtype_s.getSolrFieldName() + ":\"" + FailType.excl.name() + "\"" );
- Log.logInfo ("HostBrowser:", "delete documents with failtype_s = excl");
+ ConcurrentLog.info ("HostBrowser:", "delete documents with failtype_s = excl");
prop.putNum("ucount", fulltext.collectionSize());
return prop;
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
}
@@ -217,7 +217,7 @@ public class HostBrowser {
prop.put("hosts_list", c);
prop.put("hosts", 1);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -349,7 +349,7 @@ public class HostBrowser {
for (Map.Entry<String, FailType> e: errorDocs.entrySet()) files.put(e.getKey(), e.getValue() == FailType.fail ? StoreType.FAILED : StoreType.EXCLUDED);
for (String u: inboundLinks) if (!files.containsKey(u)) files.put(u, StoreType.LINK);
for (String u: loadingLinks) if (u.startsWith(path) && !files.containsKey(u)) files.put(u, StoreType.LINK);
- Log.logInfo("HostBrowser", "collected " + files.size() + " urls for path " + path);
+ ConcurrentLog.info("HostBrowser", "collected " + files.size() + " urls for path " + path);
// distinguish files and folders
Map<String, Object> list = new TreeMap<String, Object>(); // a directory list; if object is boolean, its a file; if its a int[], then its a folder
@@ -500,7 +500,7 @@ public class HostBrowser {
}
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.java
index fec86a89a..1e7066df3 100644
--- a/htroot/IndexControlRWIs_p.java
+++ b/htroot/IndexControlRWIs_p.java
@@ -39,6 +39,7 @@ import net.yacy.cora.document.analysis.Classification.ContentDomain;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ListManager;
import net.yacy.document.Condenser;
@@ -49,7 +50,6 @@ import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceContainerCache;
@@ -118,7 +118,7 @@ public class IndexControlRWIs_p {
try {
urlb.put(s.getBytes());
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -172,7 +172,7 @@ public class IndexControlRWIs_p {
try {
urlb.put(en.next().urlhash());
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
index = null;
@@ -191,7 +191,7 @@ public class IndexControlRWIs_p {
post.remove("keyhashdeleteall");
post.put("urllist", "generated");
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -215,7 +215,7 @@ public class IndexControlRWIs_p {
try {
urlHashes.put(b);
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
segment.termIndex().remove(keyhash, urlHashes);
@@ -224,7 +224,7 @@ public class IndexControlRWIs_p {
post.remove("keyhashdelete");
post.put("urllist", "generated");
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -286,14 +286,14 @@ public class IndexControlRWIs_p {
try {
unknownURLEntries.put(iEntry.urlhash());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
urlIter.remove();
} else {
try {
knownURLs.put(iEntry.urlhash());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -307,7 +307,7 @@ public class IndexControlRWIs_p {
try {
icc.add(index);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// transport to other peer
@@ -325,7 +325,7 @@ public class IndexControlRWIs_p {
prop.put("result", "Peer " + host + " not found");
}
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -355,7 +355,7 @@ public class IndexControlRWIs_p {
prop.put("keyhashsimilar_rows", rows + 1);
prop.put("result", "");
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -378,7 +378,7 @@ public class IndexControlRWIs_p {
try {
urlHashes.put(b);
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
url = segment.fulltext().getURL(b);
segment.fulltext().remove(b);
@@ -412,7 +412,7 @@ public class IndexControlRWIs_p {
try {
urlHashes.put(b);
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
url = segment.fulltext().getURL(b);
segment.fulltext().remove(b);
@@ -437,7 +437,7 @@ public class IndexControlRWIs_p {
try {
segment.termIndex().remove(keyhash, urlHashes);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/htroot/IndexControlURLs_p.java b/htroot/IndexControlURLs_p.java
index e75d9547a..1cb080a3f 100644
--- a/htroot/IndexControlURLs_p.java
+++ b/htroot/IndexControlURLs_p.java
@@ -38,13 +38,13 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.sorting.ReversibleScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Fulltext;
import net.yacy.search.index.Segment;
@@ -318,7 +318,7 @@ public class IndexControlURLs_p {
cnt++;
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("statisticslines_domains", cnt);
prop.put("statisticslines", 1);
diff --git a/htroot/IndexCreateQueues_p.java b/htroot/IndexCreateQueues_p.java
index b1743229b..ba54886fd 100644
--- a/htroot/IndexCreateQueues_p.java
+++ b/htroot/IndexCreateQueues_p.java
@@ -11,11 +11,11 @@ import java.util.regex.PatternSyntaxException;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.CrawlSwitchboard;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.NoticedURL.StackType;
import net.yacy.crawler.retrieval.Request;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.Seed;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -93,13 +93,13 @@ public class IndexCreateQueues_p {
if (value != null && compiledPattern.matcher(value).matches()) removehashes.add(entry.url().hash());
}
- Log.logInfo("IndexCreateQueues_p", "created a remove list with " + removehashes.size() + " entries for pattern '" + deletepattern + "'");
+ ConcurrentLog.info("IndexCreateQueues_p", "created a remove list with " + removehashes.size() + " entries for pattern '" + deletepattern + "'");
for (final byte[] b: removehashes) {
sb.crawlQueues.noticeURL.removeByURLHash(b);
}
}
} catch (final PatternSyntaxException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/htroot/IndexFederated_p.java b/htroot/IndexFederated_p.java
index 7fa17dbe8..cb70634ff 100644
--- a/htroot/IndexFederated_p.java
+++ b/htroot/IndexFederated_p.java
@@ -32,7 +32,7 @@ import net.yacy.cora.federate.solr.connector.SolrConnector;
import net.yacy.cora.federate.solr.instance.RemoteInstance;
import net.yacy.cora.federate.solr.instance.ShardInstance;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.OS;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
@@ -56,7 +56,7 @@ public class IndexFederated_p {
final int wordCacheMaxCount = (int) sb.getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000);
final long fileSizeMax = (OS.isWindows) ? sb.getConfigLong("filesize.max.win", Integer.MAX_VALUE) : sb.getConfigLong( "filesize.max.other", Integer.MAX_VALUE);
sb.index.connectRWI(wordCacheMaxCount, fileSizeMax);
- } catch (IOException e) { Log.logException(e); } // switch on
+ } catch (IOException e) { ConcurrentLog.logException(e); } // switch on
boolean post_core_citation = post.getBoolean(SwitchboardConstants.CORE_SERVICE_CITATION);
final boolean previous_core_citation = sb.index.connectedCitation() && env.getConfigBool(SwitchboardConstants.CORE_SERVICE_CITATION, false);
@@ -66,7 +66,7 @@ public class IndexFederated_p {
final int wordCacheMaxCount = (int) sb.getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000);
final long fileSizeMax = (OS.isWindows) ? sb.getConfigLong("filesize.max.win", Integer.MAX_VALUE) : sb.getConfigLong( "filesize.max.other", Integer.MAX_VALUE);
sb.index.connectCitation(wordCacheMaxCount, fileSizeMax);
- } catch (IOException e) { Log.logException(e); } // switch on
+ } catch (IOException e) { ConcurrentLog.logException(e); } // switch on
boolean post_core_fulltext = post.getBoolean(SwitchboardConstants.CORE_SERVICE_FULLTEXT);
final boolean previous_core_fulltext = sb.index.fulltext().connectedLocalSolr() && env.getConfigBool(SwitchboardConstants.CORE_SERVICE_FULLTEXT, false);
@@ -80,7 +80,7 @@ public class IndexFederated_p {
if (!previous_core_fulltext && post_core_fulltext) {
// switch on
sb.index.connectUrlDb(sb.useTailCache, sb.exceed134217727);
- try { sb.index.fulltext().connectLocalSolr(); } catch (IOException e) { Log.logException(e); }
+ try { sb.index.fulltext().connectLocalSolr(); } catch (IOException e) { ConcurrentLog.logException(e); }
}
boolean webgraph = post.getBoolean(SwitchboardConstants.CORE_SERVICE_WEBGRAPH);
@@ -119,7 +119,7 @@ public class IndexFederated_p {
try {
sb.index.fulltext().disconnectRemoteSolr();
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -135,15 +135,15 @@ public class IndexFederated_p {
sb.index.fulltext().disconnectRemoteSolr();
}
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
try {
sb.index.fulltext().disconnectRemoteSolr();
} catch (Throwable ee) {
- Log.logException(ee);
+ ConcurrentLog.logException(ee);
}
}
} catch (SolrException e) {
- Log.logSevere("IndexFederated_p", "change of solr connection failed", e);
+ ConcurrentLog.severe("IndexFederated_p", "change of solr connection failed", e);
}
boolean lazy = post.getBoolean("solr.indexing.lazy");
diff --git a/htroot/IndexImportOAIPMH_p.java b/htroot/IndexImportOAIPMH_p.java
index 698c7a38a..7214056cd 100644
--- a/htroot/IndexImportOAIPMH_p.java
+++ b/htroot/IndexImportOAIPMH_p.java
@@ -32,12 +32,12 @@ import java.util.Set;
import java.util.TreeSet;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
import net.yacy.document.importer.OAIPMHImporter;
import net.yacy.document.importer.OAIPMHLoader;
import net.yacy.document.importer.ResumptionToken;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -79,11 +79,11 @@ public class IndexImportOAIPMH_p {
prop.put("defaulturl", e.getMessage());
}
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("import-one", 2);
prop.put("import-one_error", e.getMessage());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("import-one", 2);
prop.put("import-one_error", e.getMessage());
}
@@ -101,7 +101,7 @@ public class IndexImportOAIPMH_p {
prop.put("optiongetlist", 1);
prop.put("iframetype", 1);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("status", 2);
prop.put("status_message", e.getMessage());
}
@@ -134,7 +134,7 @@ public class IndexImportOAIPMH_p {
final OAIPMHImporter job = new OAIPMHImporter(sb.loader, url);
job.start();
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/htroot/IndexReIndexMonitor_p.html b/htroot/IndexReIndexMonitor_p.html
deleted file mode 100644
index b2d01b631..000000000
--- a/htroot/IndexReIndexMonitor_p.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
- <head>
- <title>YaCy '#[clientname]#': Field Re-Indexing</title>
- #%env/templates/metas.template%#
- </head>
- <body id="IndexReindexMonitor">
-
- #%env/templates/header.template%#
- #%env/templates/submenuIndexControl.template%#
- <h2>Field Re-Indexing</h2>
- <p>In case that an index schema has changed, all documents with missing field entries can be indexed again with a reindex job.</p>
- <form action="IndexReindexMonitor_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
- <fieldset>
- <table>
- <tr>
- <td>Documents in current queue</td>
- <td>#[querysize]#</td>
- <td>#(showstartbutton)#<input type="submit" value="refresh page"/>::#(/showstartbutton)#</td>
- </tr>
- <tr>
- <td>Documents processed</td>
- <td>#[docsprocessed]#</td>
- <td></td>
- </tr>
- <tr>
- <td>current select query </td>
- <td>#[currentselectquery]#</td>
- <td></td>
- </tr>
- <tr>
- <td>&nbsp;</td>
- <td></td>
- <td></td>
- </tr>
- </table>
- #(showstartbutton)#
- <input type="submit" name="stopreindex" value="stop reindexing"/>
- ::<input type="submit" name="reindexnow" value="start reindex job now"/>
- #(/showstartbutton)#
- <p class="info">#[infomessage]#</p>
- </fieldset>
- </form>
- #%env/templates/footer.template%#
- </body>
-</html>
diff --git a/htroot/IndexSchema_p.java b/htroot/IndexSchema_p.java
index 3a0f133e5..6f75a35a4 100644
--- a/htroot/IndexSchema_p.java
+++ b/htroot/IndexSchema_p.java
@@ -25,7 +25,7 @@ import java.util.Iterator;
import net.yacy.cora.federate.solr.SchemaConfiguration;
import net.yacy.cora.federate.solr.SchemaDeclaration;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.schema.CollectionSchema;
import net.yacy.search.schema.WebgraphConfiguration;
@@ -94,7 +94,7 @@ public class IndexSchema_p {
}
cs.commit();
} catch (IOException ex) {
- Log.logWarning("IndexSchema", "file " + solrInitFile.getAbsolutePath() + " not found");
+ ConcurrentLog.warn("IndexSchema", "file " + solrInitFile.getAbsolutePath() + " not found");
}
}
diff --git a/htroot/Load_RSS_p.java b/htroot/Load_RSS_p.java
index 8908cf7cb..67380481a 100644
--- a/htroot/Load_RSS_p.java
+++ b/htroot/Load_RSS_p.java
@@ -39,6 +39,7 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.HarvestProcess;
import net.yacy.crawler.data.CrawlQueues;
@@ -48,7 +49,6 @@ import net.yacy.data.WorkTables;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.blob.Tables.Row;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.search.schema.CollectionSchema;
@@ -78,7 +78,7 @@ public class Load_RSS_p {
if (entry.getValue().startsWith("mark_")) try {
sb.tables.delete("rss", entry.getValue().substring(5).getBytes());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -103,9 +103,9 @@ public class Load_RSS_p {
sb.tables.delete("rss", pk);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (post != null && post.containsKey("removeSelectedFeedsScheduler")) {
@@ -118,9 +118,9 @@ public class Load_RSS_p {
rssRow.remove("api_pk");
sb.tables.insert("rss", pk, rssRow);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -149,9 +149,9 @@ public class Load_RSS_p {
sb.tables.insert("rss", pk, rssRow);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (post != null && post.containsKey("addSelectedFeedScheduler")) {
@@ -162,17 +162,17 @@ public class Load_RSS_p {
final byte [] pk = entry.getValue().substring(5).getBytes();
row = sb.tables.select("rss", pk);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
DigestURI url = null;
try {
url = new DigestURI(row.get("url", ""));
} catch (final MalformedURLException e) {
- Log.logWarning("Load_RSS", "malformed url '" + row.get("url", "") + "': " + e.getMessage());
+ ConcurrentLog.warn("Load_RSS", "malformed url '" + row.get("url", "") + "': " + e.getMessage());
continue;
}
// load feeds concurrently to get better responsibility in web interface
@@ -240,9 +240,9 @@ public class Load_RSS_p {
prop.put("shownewfeeds_num", newc);
prop.put("shownewfeeds", newc > 0 ? 1 : 0);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return prop;
@@ -260,7 +260,7 @@ public class Load_RSS_p {
try {
url = post.containsKey("url") ? new DigestURI(post.get("url", "")) : null;
} catch (final MalformedURLException e) {
- Log.logWarning("Load_RSS_p", "url not well-formed: '" + post.get("url", "") + "'");
+ ConcurrentLog.warn("Load_RSS_p", "url not well-formed: '" + post.get("url", "") + "'");
}
// if we have an url then try to load the rss
@@ -271,7 +271,7 @@ public class Load_RSS_p {
final byte[] resource = response == null ? null : response.getContent();
rss = resource == null ? null : RSSReader.parse(RSSFeed.DEFAULT_MAXSIZE, resource);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// index all selected items: description only
@@ -286,7 +286,7 @@ public class Load_RSS_p {
if (RSSLoader.indexTriggered.containsKey(messageurl.hash())) continue loop;
messages.put(ASCII.String(messageurl.hash()), message);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
Map<String, HarvestProcess> existingurls = sb.urlExists(messages.keySet());
@@ -298,7 +298,7 @@ public class Load_RSS_p {
list.add(messageurl);
RSSLoader.indexTriggered.insertIfAbsent(messageurl.hash(), new Date());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
sb.addToIndex(list, null, null, collections);
@@ -337,7 +337,7 @@ public class Load_RSS_p {
final DigestURI messageurl = new DigestURI(item.getLink());
urls.put(ASCII.String(messageurl.hash()), messageurl);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
}
@@ -361,7 +361,7 @@ public class Load_RSS_p {
prop.putHTML("showitems_item_" + i + "_date", (pubDate == null) ? "" : DateFormat.getDateTimeInstance().format(pubDate));
i++;
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
}
diff --git a/htroot/NetworkPicture.java b/htroot/NetworkPicture.java
index 848f0dca6..ea69c75ec 100644
--- a/htroot/NetworkPicture.java
+++ b/htroot/NetworkPicture.java
@@ -27,7 +27,7 @@
import java.util.concurrent.Semaphore;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.peers.graphics.EncodedImage;
import net.yacy.peers.graphics.NetworkGraph;
import net.yacy.search.Switchboard;
@@ -52,7 +52,7 @@ public class NetworkPicture
final long timeSeconds = System.currentTimeMillis() / 1000;
if ( buffer != null && !authorized && timeSeconds - lastAccessSeconds < 2 ) {
- Log.logInfo("NetworkPicture", "cache hit (1); authorized = "
+ ConcurrentLog.info("NetworkPicture", "cache hit (1); authorized = "
+ authorized
+ ", timeSeconds - lastAccessSeconds = "
+ (timeSeconds - lastAccessSeconds));
@@ -65,7 +65,7 @@ public class NetworkPicture
sync.acquireUninterruptibly();
if ( buffer != null && !authorized && timeSeconds - lastAccessSeconds < 2 ) {
- Log.logInfo("NetworkPicture", "cache hit (2); authorized = "
+ ConcurrentLog.info("NetworkPicture", "cache hit (2); authorized = "
+ authorized
+ ", timeSeconds - lastAccessSeconds = "
+ (timeSeconds - lastAccessSeconds));
diff --git a/htroot/News.java b/htroot/News.java
index 40ce7d549..15c6dbfc8 100644
--- a/htroot/News.java
+++ b/htroot/News.java
@@ -31,7 +31,7 @@ import java.util.Map.Entry;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.peers.NewsDB;
import net.yacy.peers.NewsPool;
import net.yacy.peers.Seed;
@@ -64,7 +64,7 @@ public class News {
id = check.substring(4);
try {
sb.peers.newsPool.moveOff(tableID, id);
- } catch (final Exception ee) {Log.logException(ee);}
+ } catch (final Exception ee) {ConcurrentLog.logException(ee);}
}
}
}
@@ -81,7 +81,7 @@ public class News {
sb.peers.newsPool.moveOffAll(tableID);
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/htroot/ProxyIndexingMonitor_p.java b/htroot/ProxyIndexingMonitor_p.java
index 7aab07adf..5384c3a0a 100644
--- a/htroot/ProxyIndexingMonitor_p.java
+++ b/htroot/ProxyIndexingMonitor_p.java
@@ -30,8 +30,8 @@
import java.io.File;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@@ -140,7 +140,7 @@ public class ProxyIndexingMonitor_p {
} catch (final Exception e) {
prop.put("info", "2"); //Error: errmsg
prop.putHTML("info_error", e.getMessage());
- Log.logSevere("SERVLET", "ProxyIndexingMonitor.case3", e);
+ ConcurrentLog.severe("SERVLET", "ProxyIndexingMonitor.case3", e);
}
}
diff --git a/htroot/ServerScannerList.java b/htroot/ServerScannerList.java
index 4809fe914..563523df3 100644
--- a/htroot/ServerScannerList.java
+++ b/htroot/ServerScannerList.java
@@ -27,9 +27,9 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.Scanner;
import net.yacy.cora.protocol.Scanner.Access;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -79,7 +79,7 @@ public class ServerScannerList {
prop.put("servertable_list_" + i + "_edit_preselected", host.getValue() == Access.granted && Scanner.inIndex(apiCommentCache, urlString) == null ? 1 : 0);
i++;
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
prop.put("servertable_list", i);
diff --git a/htroot/Steering.java b/htroot/Steering.java
index cb768a113..d4d48edb9 100644
--- a/htroot/Steering.java
+++ b/htroot/Steering.java
@@ -32,7 +32,7 @@ import java.io.File;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.peers.operation.yacyRelease;
import net.yacy.search.Switchboard;
@@ -52,13 +52,13 @@ public class Steering {
// handle access rights
if (!sb.verifyAuthentication(header)) {
- Log.logInfo("STEERING", "log-in attempt for steering from " + requestIP);
+ ConcurrentLog.info("STEERING", "log-in attempt for steering from " + requestIP);
prop.authenticationRequired();
return prop;
}
if (post.containsKey("shutdown")) {
- Log.logInfo("STEERING", "shutdown request from " + requestIP);
+ ConcurrentLog.info("STEERING", "shutdown request from " + requestIP);
sb.terminate(10, "shutdown request from Steering; ip = " + requestIP);
prop.put("info", "3");
@@ -66,7 +66,7 @@ public class Steering {
}
if (post.containsKey("restart")) {
- Log.logInfo("STEERING", "restart request from " + requestIP);
+ ConcurrentLog.info("STEERING", "restart request from " + requestIP);
yacyRelease.restart();
prop.put("info", "4");
@@ -74,7 +74,7 @@ public class Steering {
}
if (post.containsKey("update")) {
- Log.logInfo("STEERING", "update request from " + requestIP);
+ ConcurrentLog.info("STEERING", "update request from " + requestIP);
final boolean devenvironment = new File(sb.getAppPath(), ".git").exists();
final String releaseFileName = post.get("releaseinstall", "");
final File releaseFile = new File(sb.releasePath, releaseFileName);
diff --git a/htroot/Table_API_p.java b/htroot/Table_API_p.java
index 603705a07..a477760c8 100644
--- a/htroot/Table_API_p.java
+++ b/htroot/Table_API_p.java
@@ -32,10 +32,10 @@ import java.util.regex.Pattern;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.blob.Tables.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.query.QueryParams;
@@ -144,7 +144,7 @@ public class Table_API_p {
WorkTables.calculateAPIScheduler(row, false);
sb.tables.update(WorkTables.TABLE_API_NAME, row);
}
- } catch (Throwable e) { Log.logException(e); }
+ } catch (Throwable e) { ConcurrentLog.logException(e); }
}
if (post != null && !post.get("deleterows", "").isEmpty()) {
@@ -153,7 +153,7 @@ public class Table_API_p {
try {
sb.tables.delete(WorkTables.TABLE_API_NAME, entry.getValue().substring(5).getBytes());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -192,7 +192,7 @@ public class Table_API_p {
}
sb.tables.recordAPICall(post, "Table_API_p.html", WorkTables.TABLE_API_TYPE_STEERING, "delete API calls older than " + days + " days");
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -369,7 +369,7 @@ public class Table_API_p {
prop.put("showschedulerhint", 0);
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("showtable_list", count);
prop.put("showtable_num", count);
diff --git a/htroot/Table_YMark_p.java b/htroot/Table_YMark_p.java
index 319926f5f..e32e8962c 100644
--- a/htroot/Table_YMark_p.java
+++ b/htroot/Table_YMark_p.java
@@ -7,12 +7,12 @@ import java.util.regex.Pattern;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ymark.YMarkEntry;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.data.ymark.YMarkUtil;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -105,7 +105,7 @@ public class Table_YMark_p {
if (columns.isEmpty() && table != null) try {
columns = sb.tables.columns(table);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
count = 0;
@@ -121,7 +121,7 @@ public class Table_YMark_p {
count++;
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
prop.put("showselection_columns", count);
@@ -149,9 +149,9 @@ public class Table_YMark_p {
if (entry.getValue().startsWith("mark_")) try {
sb.tables.bookmarks.deleteBookmark(bmk_user, entry.getValue().substring(5).getBytes());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -166,7 +166,7 @@ public class Table_YMark_p {
try {
sb.tables.bookmarks.addBookmark(bmk_user, bmk, false, false);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -190,18 +190,18 @@ public class Table_YMark_p {
setEdit(sb, prop, table, pk, columns);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else if (post.containsKey("addrow")) try {
// get a new key
final String pk = UTF8.String(sb.tables.createRow(table));
setEdit(sb, prop, table, pk, columns);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} else {
prop.put("showtable", 1);
prop.put("showtable_table", table);
@@ -212,7 +212,7 @@ public class Table_YMark_p {
prop.put("showtable_tagsize", sb.tables.size(YMarkTables.TABLES.TAGS.tablename(bmk_user)));
prop.put("showtable_foldersize", sb.tables.size(YMarkTables.TABLES.FOLDERS.tablename(bmk_user)));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("showtable_bmksize", 0);
prop.put("showtable_tagsize", 0);
prop.put("showtable_foldersize", 0);
@@ -229,7 +229,7 @@ public class Table_YMark_p {
try {
maxcount = Math.min(maxcount, sb.tables.size(table));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
maxcount = 0;
}
count = 0;
@@ -265,7 +265,7 @@ public class Table_YMark_p {
count++;
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("showtable_list", count);
prop.put("showtable_num", count);
diff --git a/htroot/Tables_p.java b/htroot/Tables_p.java
index f1fa849a7..ec59a8ad7 100644
--- a/htroot/Tables_p.java
+++ b/htroot/Tables_p.java
@@ -27,9 +27,9 @@ import java.util.regex.Pattern;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -78,7 +78,7 @@ public class Tables_p {
if (entry.getValue().startsWith("pk_")) try {
sb.tables.delete(table, entry.getValue().substring(3).getBytes());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -94,7 +94,7 @@ public class Tables_p {
try {
sb.tables.update(table, pk.getBytes(), map);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -109,7 +109,7 @@ public class Tables_p {
try {
columns = sb.tables.columns(table);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
columns = new ArrayList<String>();
}
@@ -127,18 +127,18 @@ public class Tables_p {
setEdit(sb, prop, table, pk, columns);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else if (post.containsKey("addrow")) try {
// get a new key
final String pk = UTF8.String(sb.tables.createRow(table));
setEdit(sb, prop, table, pk, columns);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} else {
prop.put("showtable", 1);
prop.put("showtable_table", table);
@@ -154,7 +154,7 @@ public class Tables_p {
try {
maxcount = Math.min(maxcount, sb.tables.size(table));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
maxcount = 0;
}
count = 0;
@@ -180,7 +180,7 @@ public class Tables_p {
count++;
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("showtable_list", count);
prop.put("showtable_num", count);
diff --git a/htroot/Triple_p.java b/htroot/Triple_p.java
index f2412e049..aba2cd271 100644
--- a/htroot/Triple_p.java
+++ b/htroot/Triple_p.java
@@ -24,8 +24,8 @@ import java.net.MalformedURLException;
import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.http.HTTPDemon;
@@ -78,9 +78,9 @@ public class Triple_p {
}
JenaTripleStore.load(newurl);
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/htroot/User.java b/htroot/User.java
index e0561c58f..ecc898361 100644
--- a/htroot/User.java
+++ b/htroot/User.java
@@ -32,8 +32,8 @@ import net.yacy.cora.order.Digest;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@@ -135,7 +135,7 @@ public class User{
entry.setProperty(UserDB.Entry.MD5ENCODED_USERPWD_STRING, Digest.encodeMD5Hex(entry.getUserName()+":"+post.get("newpass", "")));
prop.put("status_password", "0"); //changes
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}else{
prop.put("status_password", "3"); //empty
diff --git a/htroot/ViewImage.java b/htroot/ViewImage.java
index 0e3cf8e02..a904c2cb2 100644
--- a/htroot/ViewImage.java
+++ b/htroot/ViewImage.java
@@ -38,11 +38,11 @@ import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.ConcurrentARC;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.data.URLLicense;
import net.yacy.document.ImageParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.workflow.WorkflowProcessor;
@@ -107,7 +107,7 @@ public class ViewImage {
if (url != null) try {
resourceb = sb.loader.loadContent(sb.loader.request(url, false, true), CacheStrategy.IFEXIST, BlacklistType.SEARCH, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
} catch (final IOException e) {
- Log.logFine("ViewImage", "cannot load: " + e.getMessage());
+ ConcurrentLog.fine("ViewImage", "cannot load: " + e.getMessage());
}
byte[] imgb = null;
if (resourceb == null) {
diff --git a/htroot/ViewLog_p.java b/htroot/ViewLog_p.java
index 741dd612f..affcec94a 100644
--- a/htroot/ViewLog_p.java
+++ b/htroot/ViewLog_p.java
@@ -37,8 +37,8 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.logging.GuiHandler;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.logging.LogalizerHandler;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -96,7 +96,7 @@ public class ViewLog_p {
final Pattern filterPattern = Pattern.compile(filter,Pattern.MULTILINE);
filterMatcher = filterPattern.matcher("");
} catch (final PatternSyntaxException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
int level = 0;
diff --git a/htroot/ViewProfile.java b/htroot/ViewProfile.java
index ecd46e0ef..1ccec60b9 100644
--- a/htroot/ViewProfile.java
+++ b/htroot/ViewProfile.java
@@ -43,7 +43,7 @@ import java.util.Set;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.peers.Network;
import net.yacy.peers.NewsDB;
import net.yacy.peers.NewsPool;
@@ -102,7 +102,7 @@ public class ViewProfile {
final NewsDB.Record record = sb.peers.newsPool.getByOriginator(NewsPool.INCOMING_DB, NewsPool.CATEGORY_PROFILE_UPDATE, seed.hash);
if (record != null) sb.peers.newsPool.moveOff(NewsPool.INCOMING_DB, record.id());
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// try to get the profile from remote peer
@@ -113,7 +113,7 @@ public class ViewProfile {
if (profile == null) {
prop.put("success", "2"); // peer known, but disconnected
} else {
- Network.log.logInfo("fetched profile:" + profile);
+ Network.log.info("fetched profile:" + profile);
prop.put("success", "3"); // everything ok
}
prop.putHTML("success_peername", seed.getName());
diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.java
index a3604a177..8b35afb8c 100644
--- a/htroot/Vocabulary_p.java
+++ b/htroot/Vocabulary_p.java
@@ -33,10 +33,10 @@ import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.lod.vocabulary.Tagging.SOTuple;
import net.yacy.cora.lod.vocabulary.YaCyMetadata;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.LibraryProvider;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Segment;
import net.yacy.server.serverObjects;
@@ -167,7 +167,7 @@ public class Vocabulary_p {
}
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.java
index 4f79bd618..4be6f047f 100644
--- a/htroot/WebStructurePicture_p.java
+++ b/htroot/WebStructurePicture_p.java
@@ -37,8 +37,8 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.sorting.ClusteredScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.graphics.WebStructureGraph;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -116,7 +116,7 @@ public class WebStructurePicture_p {
for (int i = 0; i < hostlist.length; i++) {
String host = hostlist[i];
String hash = null;
- try {hash = ASCII.String((new DigestURI("http://" + host)).hash(), 6, 6);} catch (final MalformedURLException e) {Log.logException(e);}
+ try {hash = ASCII.String((new DigestURI("http://" + host)).hash(), 6, 6);} catch (final MalformedURLException e) {ConcurrentLog.logException(e);}
Map.Entry<String, String> centernode = new AbstractMap.SimpleEntry<String, String>(hash, host);
double angle = 2.0d * i * Math.PI / hostlist.length;
if (hostlist.length == 3) angle -= Math.PI / 2;
diff --git a/htroot/YMarks.java b/htroot/YMarks.java
index 3fe1d795d..6f8f1dd6e 100644
--- a/htroot/YMarks.java
+++ b/htroot/YMarks.java
@@ -4,6 +4,7 @@ import java.util.Iterator;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkEntry;
@@ -11,7 +12,6 @@ import net.yacy.data.ymark.YMarkRDF;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.data.ymark.YMarkTables.TABLES;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -69,7 +69,7 @@ public class YMarks {
try {
size = sb.tables.bookmarks.getSize(bmk_user);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
size = 0;
}
prop.put("size", size);
diff --git a/htroot/api/getpageinfo.java b/htroot/api/getpageinfo.java
index 9f688b7b0..da63daa7d 100644
--- a/htroot/api/getpageinfo.java
+++ b/htroot/api/getpageinfo.java
@@ -36,10 +36,10 @@ import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.crawler.robots.RobotsTxtEntry;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -93,13 +93,13 @@ public class getpageinfo {
try {
u = new DigestURI(url);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
net.yacy.document.Document scraper = null;
if (u != null) try {
scraper = sb.loader.loadDocument(u, CacheStrategy.IFEXIST, BlacklistType.CRAWLER, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
// bad things are possible, i.e. that the Server responds with "403 Bad Behavior"
// that should not affect the robots.txt validity
}
@@ -157,7 +157,7 @@ public class getpageinfo {
final MultiProtocolURI sitemapURL = robotsEntry == null ? null : robotsEntry.getSitemap();
prop.putXML("sitemap", sitemapURL == null ? "" : sitemapURL.toString());
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
if (actions.indexOf("oai",0) >= 0) {
@@ -196,11 +196,11 @@ public class getpageinfo {
final DocumentBuilder builder = factory.newDocumentBuilder();
return parseXML(builder.parse(url));
} catch (final ParserConfigurationException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (final SAXException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (final IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
return "";
diff --git a/htroot/api/getpageinfo_p.java b/htroot/api/getpageinfo_p.java
index 46e3a77f5..d9d7c1281 100644
--- a/htroot/api/getpageinfo_p.java
+++ b/htroot/api/getpageinfo_p.java
@@ -36,10 +36,10 @@ import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.crawler.robots.RobotsTxtEntry;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -93,13 +93,13 @@ public class getpageinfo_p {
try {
u = new DigestURI(url);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
net.yacy.document.Document scraper = null;
if (u != null) try {
scraper = sb.loader.loadDocument(u, CacheStrategy.IFEXIST, BlacklistType.CRAWLER, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
// bad things are possible, i.e. that the Server responds with "403 Bad Behavior"
// that should not affect the robots.txt validity
}
@@ -158,7 +158,7 @@ public class getpageinfo_p {
final MultiProtocolURI sitemapURL = robotsEntry == null ? null : robotsEntry.getSitemap();
prop.putXML("sitemap", sitemapURL == null ? "" : sitemapURL.toString());
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
if (actions.indexOf("oai",0) >= 0) {
@@ -190,11 +190,11 @@ public class getpageinfo_p {
final DocumentBuilder builder = factory.newDocumentBuilder();
return parseXML(builder.parse(url));
} catch (final ParserConfigurationException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (final SAXException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (final IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
return "";
diff --git a/htroot/api/table_p.java b/htroot/api/table_p.java
index 5f186e551..819172fd4 100644
--- a/htroot/api/table_p.java
+++ b/htroot/api/table_p.java
@@ -26,9 +26,9 @@ import java.util.regex.Pattern;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -91,7 +91,7 @@ public class table_p {
if (entry.getValue().startsWith("pk_")) try {
sb.tables.delete(table, entry.getValue().substring(3).getBytes());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -111,9 +111,9 @@ public class table_p {
sb.tables.update(table, pk.getBytes(), map);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -126,7 +126,7 @@ public class table_p {
try {
columns = sb.tables.columns(table);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
columns = new ArrayList<String>();
}
@@ -149,7 +149,7 @@ public class table_p {
try {
maxcount = Math.min(maxcount, sb.tables.size(table));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
maxcount = 0;
}
int count = 0;
@@ -188,7 +188,7 @@ public class table_p {
count++;
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("showtable_list", count);
prop.put("showtable_num", count);
diff --git a/htroot/api/termlist_p.java b/htroot/api/termlist_p.java
index 10ff34679..6a342c8fb 100644
--- a/htroot/api/termlist_p.java
+++ b/htroot/api/termlist_p.java
@@ -28,8 +28,8 @@ import java.util.Iterator;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.sorting.Rating;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Segment;
import net.yacy.server.serverObjects;
@@ -39,7 +39,7 @@ public class termlist_p {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {
- final Log log = new Log("TERMLIST");
+ final ConcurrentLog log = new ConcurrentLog("TERMLIST");
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
Segment segment = sb.index;
@@ -86,7 +86,7 @@ public class termlist_p {
try {
segment.termIndex().delete(t);
} catch (final IOException e1) {
- log.logWarning("Error deleting " + ASCII.String(t), e1);
+ log.warn("Error deleting " + ASCII.String(t), e1);
e1.printStackTrace();
}
}
@@ -104,11 +104,11 @@ public class termlist_p {
prop.put("over10000000", over10000000);
prop.put("over100000000", over100000000);
- log.logWarning("finished termlist_p -> terms: " + c);
- log.logWarning("maxterm: "+ (maxterm == null ? "" : ASCII.String(maxterm)));
- log.logWarning("maxcount: " + maxcount);
- log.logWarning("termnumber: " + termnumber);
- log.logWarning("totalmemory: " + totalmemory);
+ log.warn("finished termlist_p -> terms: " + c);
+ log.warn("maxterm: "+ (maxterm == null ? "" : ASCII.String(maxterm)));
+ log.warn("maxcount: " + maxcount);
+ log.warn("termnumber: " + termnumber);
+ log.warn("totalmemory: " + totalmemory);
// return rewrite properties
return prop;
}
diff --git a/htroot/api/timeline.java b/htroot/api/timeline.java
index 0bc759df5..75bdcba41 100644
--- a/htroot/api/timeline.java
+++ b/htroot/api/timeline.java
@@ -30,9 +30,9 @@ import java.util.Iterator;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.word.WordReference;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.TermSearch;
import net.yacy.kelondro.util.ISO639;
@@ -88,7 +88,7 @@ public final class timeline {
try {
search = segment.termIndex().query(q, qg.getExcludeHashes(), null, Segment.wordReferenceFactory, maxdist);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
ReferenceContainer<WordReference> index = search.joined();
@@ -111,7 +111,7 @@ public final class timeline {
prop.put("event", c);
// log
- Network.log.logInfo("EXIT TIMELINE SEARCH: " +
+ Network.log.info("EXIT TIMELINE SEARCH: " +
QueryParams.anonymizedQueryHashes(q) + " - " + joincount + " links found, " +
prop.get("linkcount", "?") + " links selected, " +
indexabstractContainercount + " index abstracts, " +
diff --git a/htroot/api/webstructure.java b/htroot/api/webstructure.java
index 3e7f1bede..9b7d30467 100644
--- a/htroot/api/webstructure.java
+++ b/htroot/api/webstructure.java
@@ -34,10 +34,10 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.kelondro.data.citation.CitationReference;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.IndexCell;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.peers.graphics.WebStructureGraph;
@@ -100,7 +100,7 @@ public class webstructure {
if (url != null) try {
scraper = sb.loader.loadDocument(url, CacheStrategy.IFEXIST, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (scraper != null) {
prop.put("references_count", 1);
diff --git a/htroot/api/yacydoc.java b/htroot/api/yacydoc.java
index 038ddc1f5..2470049fb 100644
--- a/htroot/api/yacydoc.java
+++ b/htroot/api/yacydoc.java
@@ -35,10 +35,10 @@ import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.lod.vocabulary.YaCyMetadata;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.RequestHeader.FileType;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Segment;
import net.yacy.server.serverObjects;
@@ -93,7 +93,7 @@ public class yacydoc {
final DigestURI url = new DigestURI(urlstring);
urlhash = ASCII.String(url.hash());
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
if (urlhash == null || urlhash.isEmpty()) return prop;
@@ -145,7 +145,7 @@ public class yacydoc {
references += r.toString()+",";
}
- Log.logInfo("yacydoc", references);
+ ConcurrentLog.info("yacydoc", references);
prop.put("taglinks", references);
diff --git a/htroot/api/ymarks/add_ymark.java b/htroot/api/ymarks/add_ymark.java
index e90e22f60..209923e1c 100644
--- a/htroot/api/ymarks/add_ymark.java
+++ b/htroot/api/ymarks/add_ymark.java
@@ -1,13 +1,13 @@
import java.io.IOException;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkEntry;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.data.ymark.YMarkUtil;
import net.yacy.document.Parser.Failure;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -41,10 +41,10 @@ public class add_ymark {
prop.put("status", "1");
} catch (final IOException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Failure e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else if(post.containsKey(YMarkEntry.BOOKMARK.URL.key())) {
@@ -72,7 +72,7 @@ public class add_ymark {
try {
sb.tables.bookmarks.addBookmark(bmk_user, bmk, false, false);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("status", "1");
} else {
diff --git a/htroot/api/ymarks/delete_ymark.java b/htroot/api/ymarks/delete_ymark.java
index ba17deca8..fdc8c7e1d 100644
--- a/htroot/api/ymarks/delete_ymark.java
+++ b/htroot/api/ymarks/delete_ymark.java
@@ -1,12 +1,12 @@
import java.io.IOException;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkEntry;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.data.ymark.YMarkUtil;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -39,9 +39,9 @@ public class delete_ymark {
sb.tables.bookmarks.deleteBookmark(bmk_user, urlHash);
prop.put("result", "1");
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
prop.put(serverObjects.ACTION_AUTHENTICATE, YMarkTables.USER_AUTHENTICATE_MSG);
diff --git a/htroot/api/ymarks/get_metadata.java b/htroot/api/ymarks/get_metadata.java
index 3a1173264..3b7464ee5 100644
--- a/htroot/api/ymarks/get_metadata.java
+++ b/htroot/api/ymarks/get_metadata.java
@@ -5,6 +5,7 @@ import java.util.Iterator;
import java.util.regex.Pattern;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkAutoTagger;
import net.yacy.data.ymark.YMarkCrawlStart;
@@ -15,7 +16,6 @@ import net.yacy.data.ymark.YMarkUtil;
import net.yacy.document.Document;
import net.yacy.document.Parser.Failure;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -73,15 +73,15 @@ public class get_metadata {
} catch (final MalformedURLException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("status", "error");
} catch (final IOException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("status", "error");
} catch (final Failure e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("status", "error");
}
} else {
diff --git a/htroot/api/ymarks/get_treeview.java b/htroot/api/ymarks/get_treeview.java
index 24fc954d1..5e121d7ea 100644
--- a/htroot/api/ymarks/get_treeview.java
+++ b/htroot/api/ymarks/get_treeview.java
@@ -9,6 +9,7 @@ import java.util.regex.Pattern;
import net.yacy.cora.date.ISO8601Formatter;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkAutoTagger;
@@ -22,7 +23,6 @@ import net.yacy.document.Document;
import net.yacy.document.Parser.Failure;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -95,7 +95,7 @@ public class get_treeview {
// it = sb.tables.bookmarks.folders.getFolders(bmk_user, root);
it = sb.tables.bookmarks.getFolders(bmk_user, root).iterator();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
int n = Pattern.compile(YMarkUtil.FOLDERS_SEPARATOR).split(root, 0).length;
if (n == 0) n = 1;
@@ -205,9 +205,9 @@ public class get_treeview {
prop.put("folders", count);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else if (isAutoTagger || isMetadata || isURLdb || isCrawlStart) {
try {
@@ -230,7 +230,7 @@ public class get_treeview {
} else if(isURLdb) {
count = putMeta(count, meta.getMetadata());
} else if(isCrawlStart) {
- Log.logInfo("YMark", "I am looking for CrawlStart: "+post.get(ROOT).substring(2));
+ ConcurrentLog.info("YMark", "I am looking for CrawlStart: "+post.get(ROOT).substring(2));
final YMarkCrawlStart crawlStart = new YMarkCrawlStart(sb.tables, post.get(ROOT).substring(2));
final Iterator<String> iter = crawlStart.keySet().iterator();
String key;
@@ -244,11 +244,11 @@ public class get_treeview {
}
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Failure e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} else {
diff --git a/htroot/api/ymarks/get_xbel.java b/htroot/api/ymarks/get_xbel.java
index b02965bd2..3ed5c6e05 100644
--- a/htroot/api/ymarks/get_xbel.java
+++ b/htroot/api/ymarks/get_xbel.java
@@ -4,6 +4,7 @@ import java.util.Iterator;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkDate;
import net.yacy.data.ymark.YMarkEntry;
@@ -12,7 +13,6 @@ import net.yacy.data.ymark.YMarkUtil;
import net.yacy.data.ymark.YMarkXBELImporter;
import net.yacy.document.parser.html.CharacterCoding;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -62,7 +62,7 @@ public class get_xbel {
try {
fit = sb.tables.bookmarks.getFolders(bmk_user, root).iterator();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
while (fit.hasNext()) {
diff --git a/htroot/api/ymarks/get_ymark.java b/htroot/api/ymarks/get_ymark.java
index 4e2332ab0..5560f2010 100644
--- a/htroot/api/ymarks/get_ymark.java
+++ b/htroot/api/ymarks/get_ymark.java
@@ -5,6 +5,7 @@ import java.util.regex.Pattern;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkCrawlStart;
import net.yacy.data.ymark.YMarkDate;
@@ -14,7 +15,6 @@ import net.yacy.data.ymark.YMarkUtil;
import net.yacy.data.ymark.YMarkTables.TABLES;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.blob.Tables.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -84,7 +84,7 @@ public class get_ymark {
total = result.size();
bookmarks = result.iterator();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("page", page);
prop.put("total", total);
diff --git a/htroot/api/ymarks/import_ymark.java b/htroot/api/ymarks/import_ymark.java
index 968ffcdcc..9a2ed0795 100644
--- a/htroot/api/ymarks/import_ymark.java
+++ b/htroot/api/ymarks/import_ymark.java
@@ -14,6 +14,7 @@ import java.util.zip.GZIPInputStream;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.BookmarksDB;
import net.yacy.data.UserDB;
import net.yacy.data.WorkTables;
@@ -30,7 +31,6 @@ import net.yacy.data.ymark.YMarkXBELImporter;
import net.yacy.document.Parser.Failure;
import net.yacy.document.content.SurrogateReader;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.workflow.InstantBusyThread;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -95,7 +95,7 @@ public class import_ymark {
surrogateReader = new SurrogateReader(stream, queueSize);
} catch (final IOException e) {
//TODO: display an error message
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("status", "0");
return prop;
}
@@ -110,7 +110,7 @@ public class import_ymark {
reader = new MonitoredReader(new InputStreamReader(stream,"UTF-8"), 1024*16, bytes.length);
} catch (final UnsupportedEncodingException e1) {
//TODO: display an error message
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
prop.put("status", "0");
return prop;
}
@@ -126,7 +126,7 @@ public class import_ymark {
xbelImporter = new YMarkXBELImporter(reader, queueSize, root);
} catch (final SAXException e) {
//TODO: display an error message
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("status", "0");
return prop;
}
@@ -161,9 +161,9 @@ public class import_ymark {
}
prop.put("status", "1");
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Failure e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else if(post.containsKey("importer") && post.get("importer").equals("bmks")) {
if(!isAdmin) {
@@ -191,9 +191,9 @@ public class import_ymark {
sb.tables.bookmarks.addBookmark(bmk_user, bmk_entry, merge, true);
prop.put("status", "1");
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} catch (IOException e1) {
}
@@ -221,7 +221,7 @@ public class import_ymark {
prop.put("status", "1");
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} else {
@@ -255,9 +255,9 @@ public class import_ymark {
}
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/htroot/api/ymarks/manage_tags.java b/htroot/api/ymarks/manage_tags.java
index 7fe906c23..ac43ec052 100644
--- a/htroot/api/ymarks/manage_tags.java
+++ b/htroot/api/ymarks/manage_tags.java
@@ -3,12 +3,12 @@ import java.util.Iterator;
import java.util.regex.Pattern;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.data.ymark.YMarkUtil;
import net.yacy.data.ymark.YMarkTables.TABLES;
import net.yacy.kelondro.blob.Tables.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -74,7 +74,7 @@ public class manage_tags {
sb.tables.bookmarks.replaceTags(row_iter, bmk_user, tags, replace);
prop.put("status", 1);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
prop.put(serverObjects.ACTION_AUTHENTICATE, YMarkTables.USER_AUTHENTICATE_MSG);
diff --git a/htroot/gsa/searchresult.java b/htroot/gsa/searchresult.java
index 0aa56eb0f..1ef6fb6d3 100644
--- a/htroot/gsa/searchresult.java
+++ b/htroot/gsa/searchresult.java
@@ -31,7 +31,7 @@ import net.yacy.cora.federate.solr.connector.EmbeddedSolrConnector;
import net.yacy.cora.federate.solr.responsewriter.GSAResponseWriter;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.query.AccessTracker;
import net.yacy.search.query.QueryGoal;
@@ -98,7 +98,7 @@ public class searchresult {
// check post
if (post == null) {post = new serverObjects(); post.put("q", ""); post.put("num", "0");}
- Log.logInfo("GSA Query", post.toString());
+ ConcurrentLog.info("GSA Query", post.toString());
sb.intermissionAllThreads(3000); // tell all threads to do nothing for a specific time
// rename post fields according to result style
@@ -189,7 +189,7 @@ public class searchresult {
try {response = connector.query(req);} catch (SolrException ee) {e = ee;}
if (response != null) e = response.getException();
if (e != null) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
if (req != null) req.close();
SolrRequestInfo.clearRequestInfo();
return null;
diff --git a/htroot/rct_p.java b/htroot/rct_p.java
index 9dc208ca0..b8c7efb66 100644
--- a/htroot/rct_p.java
+++ b/htroot/rct_p.java
@@ -70,7 +70,7 @@ public class rct_p {
final String urlRejectReason = sb.crawlStacker.urlInAcceptedDomain(url);
if (urlRejectReason == null) {
// stack url
- if (sb.getLog().isFinest()) sb.getLog().logFinest("crawlOrder: stack: url='" + url + "'");
+ if (sb.getLog().isFinest()) sb.getLog().finest("crawlOrder: stack: url='" + url + "'");
sb.crawlStacker.enqueueEntry(new Request(
peerhash.getBytes(),
url,
@@ -84,7 +84,7 @@ public class rct_p {
item.getSize()
));
} else {
- env.getLog().logWarning("crawlOrder: Rejected URL '" + urlToString(url) + "': " + urlRejectReason);
+ env.getLog().warn("crawlOrder: Rejected URL '" + urlToString(url) + "': " + urlRejectReason);
}
}
}
diff --git a/htroot/solr/select.java b/htroot/solr/select.java
index 662df9a5f..0a1dd1605 100644
--- a/htroot/solr/select.java
+++ b/htroot/solr/select.java
@@ -39,7 +39,7 @@ import net.yacy.cora.federate.solr.responsewriter.YJsonResponseWriter;
import net.yacy.cora.federate.solr.responsewriter.OpensearchResponseWriter;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.query.AccessTracker;
@@ -150,7 +150,7 @@ public class select {
// check post
if (post == null) {post = new serverObjects(); post.put(CommonParams.Q, ""); post.put(CommonParams.ROWS, "0");}
if (post.size() > 100) {
- Log.logWarning("select", "rejected bad-formed search request with " + post.size() + " properties from " + header.refererHost());
+ ConcurrentLog.warn("select", "rejected bad-formed search request with " + post.size() + " properties from " + header.refererHost());
return null; // prevent the worst hacks here...
}
sb.intermissionAllThreads(3000); // tell all threads to do nothing for a specific time
@@ -221,7 +221,7 @@ public class select {
try {response = connector.query(req);} catch (SolrException ee) {e = ee;}
if (response != null) e = response.getException();
if (e != null) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
if (req != null) req.close();
SolrRequestInfo.clearRequestInfo();
return null;
@@ -246,7 +246,7 @@ public class select {
AccessTracker.addToDump(q, Integer.toString(matches));
}
- Log.logInfo("SOLR Query", "results: " + matches + ", for query:" + post.toString());
+ ConcurrentLog.info("SOLR Query", "results: " + matches + ", for query:" + post.toString());
return null;
}
}
diff --git a/htroot/solr/update.java b/htroot/solr/update.java
index 90a6615b7..fb6d463c7 100644
--- a/htroot/solr/update.java
+++ b/htroot/solr/update.java
@@ -21,7 +21,7 @@
import java.io.OutputStream;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@@ -36,7 +36,7 @@ public class update {
}
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, @SuppressWarnings("unused") final serverSwitch env, @SuppressWarnings("unused") final OutputStream out) {
- Log.logInfo("update", "post = " + post == null ? "NULL" : post.toString());
+ ConcurrentLog.info("update", "post = " + post == null ? "NULL" : post.toString());
return null;
}
}
diff --git a/htroot/yacy/crawlReceipt.java b/htroot/yacy/crawlReceipt.java
index fdf952781..2b1fcbf25 100644
--- a/htroot/yacy/crawlReceipt.java
+++ b/htroot/yacy/crawlReceipt.java
@@ -31,11 +31,11 @@ import java.io.IOException;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.crawler.data.ResultURLs.EventOrigin;
import net.yacy.crawler.data.ZURL.FailCategory;
import net.yacy.kelondro.data.meta.URIMetadataRow;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.Protocol;
import net.yacy.peers.Seed;
import net.yacy.repository.Blacklist.BlacklistType;
@@ -59,7 +59,7 @@ public final class crawlReceipt {
return prop;
}
- final Log log = sb.getLog();
+ final ConcurrentLog log = sb.getLog();
//int proxyPrefetchDepth = Integer.parseInt(env.getConfig("proxyPrefetchDepth", "0"));
//int crawlingDepth = Integer.parseInt(env.getConfig("crawlingDepth", "0"));
@@ -117,13 +117,13 @@ public final class crawlReceipt {
// generating a new loaded URL entry
final URIMetadataRow entry = URIMetadataRow.importEntry(propStr);
if (entry == null) {
- if (log.isWarning()) log.logWarning("crawlReceipt: RECEIVED wrong RECEIPT (entry null) from peer " + iam + "\n\tURL properties: "+ propStr);
+ if (log.isWarn()) log.warn("crawlReceipt: RECEIVED wrong RECEIPT (entry null) from peer " + iam + "\n\tURL properties: "+ propStr);
prop.put("delay", "3600");
return prop;
}
if (entry.url() == null) {
- if (log.isWarning()) log.logWarning("crawlReceipt: RECEIVED wrong RECEIPT (url null) for hash " + ASCII.String(entry.hash()) + " from peer " + iam + "\n\tURL properties: "+ propStr);
+ if (log.isWarn()) log.warn("crawlReceipt: RECEIVED wrong RECEIPT (url null) for hash " + ASCII.String(entry.hash()) + " from peer " + iam + "\n\tURL properties: "+ propStr);
prop.put("delay", "3600");
return prop;
}
@@ -131,7 +131,7 @@ public final class crawlReceipt {
// check if the entry is in our network domain
final String urlRejectReason = sb.crawlStacker.urlInAcceptedDomain(entry.url());
if (urlRejectReason != null) {
- log.logWarning("crawlReceipt: RECEIVED wrong RECEIPT (" + urlRejectReason + ") for hash " + ASCII.String(entry.hash()) + " from peer " + iam + "\n\tURL properties: "+ propStr);
+ log.warn("crawlReceipt: RECEIVED wrong RECEIPT (" + urlRejectReason + ") for hash " + ASCII.String(entry.hash()) + " from peer " + iam + "\n\tURL properties: "+ propStr);
prop.put("delay", "9999");
return prop;
}
@@ -139,7 +139,7 @@ public final class crawlReceipt {
// Check URL against DHT blacklist
if (Switchboard.urlBlacklist.isListed(BlacklistType.DHT, entry)) {
// URL is blacklisted
- log.logWarning("crawlReceipt: RECEIVED wrong RECEIPT (URL is blacklisted) for URL " + ASCII.String(entry.hash()) + ":" + entry.url().toNormalform(false) + " from peer " + iam);
+ log.warn("crawlReceipt: RECEIVED wrong RECEIPT (URL is blacklisted) for URL " + ASCII.String(entry.hash()) + ":" + entry.url().toNormalform(false) + " from peer " + iam);
prop.put("delay", "9999");
return prop;
}
@@ -149,13 +149,13 @@ public final class crawlReceipt {
sb.index.fulltext().putMetadata(entry);
ResultURLs.stack(ASCII.String(entry.url().hash()), entry.url().getHost(), youare.getBytes(), iam.getBytes(), EventOrigin.REMOTE_RECEIPTS);
sb.crawlQueues.delegatedURL.remove(entry.hash()); // the delegated work has been done
- if (log.isInfo()) log.logInfo("crawlReceipt: RECEIVED RECEIPT from " + otherPeerName + " for URL " + ASCII.String(entry.hash()) + ":" + entry.url().toNormalform(false));
+ if (log.isInfo()) log.info("crawlReceipt: RECEIVED RECEIPT from " + otherPeerName + " for URL " + ASCII.String(entry.hash()) + ":" + entry.url().toNormalform(false));
// ready for more
prop.put("delay", "10");
return prop;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
prop.put("delay", "3600");
return prop;
}
diff --git a/htroot/yacy/hello.java b/htroot/yacy/hello.java
index d53d0a1ea..77282b576 100644
--- a/htroot/yacy/hello.java
+++ b/htroot/yacy/hello.java
@@ -36,7 +36,7 @@ import java.util.Map;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.peers.Network;
import net.yacy.peers.DHTSelection;
import net.yacy.peers.Protocol;
@@ -80,12 +80,12 @@ public final class hello {
final InetAddress ias = Domains.dnsResolve(clientip);
final long time_dnsResolve = System.currentTimeMillis() - time;
if (ias == null) {
- Network.log.logInfo("hello/server: failed contacting seed; clientip not resolvable (clientip=" + clientip + ", time_dnsResolve=" + time_dnsResolve + ")");
+ Network.log.info("hello/server: failed contacting seed; clientip not resolvable (clientip=" + clientip + ", time_dnsResolve=" + time_dnsResolve + ")");
prop.put("message", "cannot resolve your IP from your reported location " + clientip);
return prop;
}
if (seed.length() > Seed.maxsize) {
- Network.log.logInfo("hello/server: rejected contacting seed; too large (" + seed.length() + " > " + Seed.maxsize + ", time_dnsResolve=" + time_dnsResolve + ")");
+ Network.log.info("hello/server: rejected contacting seed; too large (" + seed.length() + " > " + Seed.maxsize + ", time_dnsResolve=" + time_dnsResolve + ")");
prop.put("message", "your seed is too long (" + seed.length() + ")");
return prop;
}
@@ -93,13 +93,13 @@ public final class hello {
try {
remoteSeed = Seed.genRemoteSeed(seed, true, ias.getHostAddress());
} catch (final IOException e) {
- Network.log.logInfo("hello/server: bad seed: " + e.getMessage() + ", time_dnsResolve=" + time_dnsResolve);
+ Network.log.info("hello/server: bad seed: " + e.getMessage() + ", time_dnsResolve=" + time_dnsResolve);
prop.put("message", "bad seed: " + e.getMessage());
return prop;
}
if (remoteSeed == null || remoteSeed.hash == null) {
- Network.log.logInfo("hello/server: bad seed: null, time_dnsResolve=" + time_dnsResolve);
+ Network.log.info("hello/server: bad seed: null, time_dnsResolve=" + time_dnsResolve);
prop.put("message", "cannot parse your seed");
return prop;
}
@@ -186,12 +186,12 @@ public final class hello {
remoteSeed.put(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR);
}
// connect the seed
- Network.log.logInfo("hello/server: responded remote senior peer '" + remoteSeed.getName() + "' from " + reportedip + ", time_dnsResolve=" + time_dnsResolve + ", time_backping=" + time_backping + ", method=" + backping_method + ", urls=" + callback[0]);
+ Network.log.info("hello/server: responded remote senior peer '" + remoteSeed.getName() + "' from " + reportedip + ", time_dnsResolve=" + time_dnsResolve + ", time_backping=" + time_backping + ", method=" + backping_method + ", urls=" + callback[0]);
sb.peers.peerActions.peerArrival(remoteSeed, true);
} else {
prop.put(Seed.YOURTYPE, Seed.PEERTYPE_JUNIOR);
remoteSeed.put(Seed.PEERTYPE, Seed.PEERTYPE_JUNIOR);
- Network.log.logInfo("hello/server: responded remote junior peer '" + remoteSeed.getName() + "' from " + reportedip + ", time_dnsResolve=" + time_dnsResolve + ", time_backping=" + time_backping + ", method=" + backping_method + ", urls=" + callback[0]);
+ Network.log.info("hello/server: responded remote junior peer '" + remoteSeed.getName() + "' from " + reportedip + ", time_dnsResolve=" + time_dnsResolve + ", time_backping=" + time_backping + ", method=" + backping_method + ", urls=" + callback[0]);
// no connection here, instead store junior in connection cache
if ((remoteSeed.hash != null) && (remoteSeed.isProper(false) == null)) {
sb.peers.peerActions.peerPing(remoteSeed);
@@ -202,7 +202,7 @@ public final class hello {
// update event tracker
EventTracker.update(EventTracker.EClass.PEERPING, new ProfilingGraph.EventPing(remoteSeed.getName(), sb.peers.myName(), false, connectedAfter - connectedBefore), false);
if (!(prop.get(Seed.YOURTYPE)).equals(reportedPeerType)) {
- Network.log.logInfo("hello/server: changing remote peer '" + remoteSeed.getName() +
+ Network.log.info("hello/server: changing remote peer '" + remoteSeed.getName() +
"' [" + reportedip +
"] peerType from '" + reportedPeerType +
"' to '" + prop.get(Seed.YOURTYPE) + "'.");
@@ -237,7 +237,7 @@ public final class hello {
count++;
}
} catch (final ConcurrentModificationException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -249,7 +249,7 @@ public final class hello {
prop.put("seedlist", seeds.toString());
// return rewrite properties
prop.put("message", "ok " + seed.length());
- Network.log.logInfo("hello/server: responded remote peer '" + remoteSeed.getName() + "' [" + reportedip + "] in " + (System.currentTimeMillis() - start) + " milliseconds");
+ Network.log.info("hello/server: responded remote peer '" + remoteSeed.getName() + "' [" + reportedip + "] in " + (System.currentTimeMillis() - start) + " milliseconds");
return prop;
}
diff --git a/htroot/yacy/message.java b/htroot/yacy/message.java
index 242f72c63..83cbde532 100644
--- a/htroot/yacy/message.java
+++ b/htroot/yacy/message.java
@@ -39,8 +39,8 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.MessageBoard;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.Network;
import net.yacy.peers.Protocol;
import net.yacy.peers.Seed;
@@ -153,7 +153,7 @@ public final class message {
try {
Files.copy(notifierSource, notifierDest);
} catch (final IOException e) {
- Log.logSevere("MESSAGE", "NEW MESSAGE ARRIVED! (error: " + e.getMessage() + ")");
+ ConcurrentLog.severe("MESSAGE", "NEW MESSAGE ARRIVED! (error: " + e.getMessage() + ")");
}
}
@@ -212,7 +212,7 @@ public final class message {
email.print(emailTxt.toString());
email.close();
} catch (final Exception e) {
- Network.log.logWarning("message: message forwarding via email failed. ",e);
+ Network.log.warn("message: message forwarding via email failed. ",e);
}
}
diff --git a/htroot/yacy/query.java b/htroot/yacy/query.java
index 35ce03125..a2f7d27c9 100644
--- a/htroot/yacy/query.java
+++ b/htroot/yacy/query.java
@@ -32,7 +32,7 @@ import java.io.IOException;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.peers.Network;
import net.yacy.peers.Protocol;
import net.yacy.search.Switchboard;
@@ -98,7 +98,7 @@ public final class query {
prop.put("response", sb.index.termIndex() == null ? 0 : sb.index.termIndex().get(env.getBytes(), null).size());
return prop;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (obj.equals("rwicount")) {
diff --git a/htroot/yacy/search.java b/htroot/yacy/search.java
index d507ce8a8..cc9793738 100644
--- a/htroot/yacy/search.java
+++ b/htroot/yacy/search.java
@@ -196,11 +196,11 @@ public final class search {
try {
remoteSeed = Seed.genRemoteSeed(oseed, false, client);
} catch (final IOException e) {
- Network.log.logInfo("yacy.search: access with bad seed: " + e.getMessage());
+ Network.log.info("yacy.search: access with bad seed: " + e.getMessage());
remoteSeed = null;
}
if (sb.peers == null) {
- Network.log.logSevere("yacy.search: seed cache not initialized");
+ Network.log.severe("yacy.search: seed cache not initialized");
} else {
sb.peers.peerActions.peerArrival(remoteSeed, true);
}
@@ -253,7 +253,7 @@ public final class search {
0.0d,
0.0d
);
- Network.log.logInfo("INIT HASH SEARCH (abstracts only): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");
+ Network.log.info("INIT HASH SEARCH (abstracts only): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");
final long timer = System.currentTimeMillis();
//final Map<byte[], ReferenceContainer<WordReference>>[] containers = sb.indexSegment.index().searchTerm(theQuery.queryHashes, theQuery.excludeHashes, plasmaSearchQuery.hashes2StringSet(urls));
@@ -317,7 +317,7 @@ public final class search {
0.0d,
0.0d
);
- Network.log.logInfo("INIT HASH SEARCH (query-" + abstracts + "): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");
+ Network.log.info("INIT HASH SEARCH (query-" + abstracts + "): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");
EventChannel.channels(EventChannel.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()), ""));
// make event
@@ -435,7 +435,7 @@ public final class search {
if (MemoryControl.shortStatus()) sb.remoteSearchTracker.clear();
// log
- Network.log.logInfo("EXIT HASH SEARCH: " +
+ Network.log.info("EXIT HASH SEARCH: " +
QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + resultCount + " links found, " +
prop.get("linkcount", "?") + " links selected, " +
indexabstractContainercount + " index abstracts, " +
diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.java
index fc747ff9d..fe92ae40e 100644
--- a/htroot/yacy/transferRWI.java
+++ b/htroot/yacy/transferRWI.java
@@ -39,11 +39,11 @@ import net.yacy.cora.federate.yacy.Distribution;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.peers.EventChannel;
import net.yacy.peers.Network;
@@ -106,39 +106,39 @@ public final class transferRWI {
final StringBuilder unknownURLs = new StringBuilder(6000);
if ((youare == null) || (!youare.equals(sb.peers.mySeed().hash))) {
- sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". Wrong target. Wanted peer=" + youare + ", iam=" + sb.peers.mySeed().hash);
+ sb.getLog().info("Rejecting RWIs from peer " + otherPeerName + ". Wrong target. Wanted peer=" + youare + ", iam=" + sb.peers.mySeed().hash);
result = "wrong_target";
pause = 0;
} else if (otherPeer == null) {
// we dont want to receive indexes
- sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". Not granted. Other Peer is unknown");
+ sb.getLog().info("Rejecting RWIs from peer " + otherPeerName + ". Not granted. Other Peer is unknown");
result = "not_granted";
pause = 60000;
} else if (!granted) {
// we dont want to receive indexes
- sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". Granted is false");
+ sb.getLog().info("Rejecting RWIs from peer " + otherPeerName + ". Granted is false");
result = "not_granted";
pause = 60000;
} else if (sb.isRobinsonMode()) {
// we dont want to receive indexes
- sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". Not granted. This peer is in robinson mode");
+ sb.getLog().info("Rejecting RWIs from peer " + otherPeerName + ". Not granted. This peer is in robinson mode");
result = "not_granted";
pause = 60000;
} else if (sb.index.RWIBufferCount() > cachelimit) {
// we are too busy to receive indexes
- sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". We are too busy (buffersize=" + sb.index.RWIBufferCount() + ").");
+ sb.getLog().info("Rejecting RWIs from peer " + otherPeerName + ". We are too busy (buffersize=" + sb.index.RWIBufferCount() + ").");
granted = false; // don't accept more words if there are too many words to flush
result = "busy";
pause = 60000;
} else if (otherPeer.getVersion() < 0.75005845 && otherPeer.getVersion() >= 0.75005821) {
// version that sends [B@... hashes
- sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". Bad version.");
+ sb.getLog().info("Rejecting RWIs from peer " + otherPeerName + ". Bad version.");
result = "not_granted";
pause = 1800000;
} else {
// we want and can receive indexes
// log value status (currently added to find outOfMemory error
- if (sb.getLog().isFine()) sb.getLog().logFine("Processing " + indexes.length + " bytes / " + wordc + " words / " + entryc + " entries from " + otherPeerName);
+ if (sb.getLog().isFine()) sb.getLog().fine("Processing " + indexes.length + " bytes / " + wordc + " words / " + entryc + " entries from " + otherPeerName);
final long startProcess = System.currentTimeMillis();
// decode request
@@ -180,7 +180,7 @@ public final class transferRWI {
// block blacklisted entries
if ((blockBlacklist) && (Switchboard.urlBlacklist.hashInBlacklistedCache(BlacklistType.DHT, urlHash))) {
- Network.log.logFine("transferRWI: blocked blacklisted URLHash '" + ASCII.String(urlHash) + "' from peer " + otherPeerName);
+ Network.log.fine("transferRWI: blocked blacklisted URLHash '" + ASCII.String(urlHash) + "' from peer " + otherPeerName);
blocked++;
continue;
}
@@ -188,7 +188,7 @@ public final class transferRWI {
// check if the entry is in our network domain
final String urlRejectReason = sb.crawlStacker.urlInAcceptedDomainHash(urlHash);
if (urlRejectReason != null) {
- Network.log.logWarning("transferRWI: blocked URL hash '" + ASCII.String(urlHash) + "' (" + urlRejectReason + ") from peer " + otherPeerName + "; peer is suspected to be a spam-peer (or something is wrong)");
+ Network.log.warn("transferRWI: blocked URL hash '" + ASCII.String(urlHash) + "' (" + urlRejectReason + ") from peer " + otherPeerName + "; peer is suspected to be a spam-peer (or something is wrong)");
//if (yacyCore.log.isFine()) yacyCore.log.logFine("transferRWI: blocked URL hash '" + urlHash + "' (" + urlRejectReason + ") from peer " + otherPeerName);
blocked++;
continue;
@@ -198,7 +198,7 @@ public final class transferRWI {
try {
sb.index.storeRWI(ASCII.getBytes(wordHash), iEntry);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
serverCore.checkInterruption();
@@ -215,7 +215,7 @@ public final class transferRWI {
unknownURL.put(ASCII.getBytes(id));
}
} catch (SpaceExceededException e) {
- sb.getLog().logWarning("transferRWI: DB-Error while trying to determine if URL with hash '" + id + "' is known.", e);
+ sb.getLog().warn("transferRWI: DB-Error while trying to determine if URL with hash '" + id + "' is known.", e);
}
}
sb.peers.mySeed().incRI(received);
@@ -228,12 +228,12 @@ public final class transferRWI {
}
if (unknownURLs.length() > 0) { unknownURLs.setLength(unknownURLs.length() - 1); }
if (wordhashes.isEmpty() || received == 0) {
- sb.getLog().logInfo("Received 0 RWIs from " + otherPeerName + ", processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, requesting " + unknownURL.size() + " URLs, blocked " + blocked + " RWIs");
+ sb.getLog().info("Received 0 RWIs from " + otherPeerName + ", processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, requesting " + unknownURL.size() + " URLs, blocked " + blocked + " RWIs");
} else {
final String firstHash = wordhashes.get(0);
final String lastHash = wordhashes.get(wordhashes.size() - 1);
final long avdist = (Distribution.horizontalDHTDistance(firstHash.getBytes(), ASCII.getBytes(sb.peers.mySeed().hash)) + Distribution.horizontalDHTDistance(lastHash.getBytes(), ASCII.getBytes(sb.peers.mySeed().hash))) / 2;
- sb.getLog().logInfo("Received " + received + " RWIs, " + wordc + " Words [" + firstHash + " .. " + lastHash + "], processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, " + avdist + ", blocked " + blocked + ", requesting " + unknownURL.size() + "/" + received+ " URLs from " + otherPeerName);
+ sb.getLog().info("Received " + received + " RWIs, " + wordc + " Words [" + firstHash + " .. " + lastHash + "], processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, " + avdist + ", blocked " + blocked + ", requesting " + unknownURL.size() + "/" + received+ " URLs from " + otherPeerName);
EventChannel.channels(EventChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + " RWIs, " + wordc + " Words [" + firstHash + " .. " + lastHash + "], processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, " + avdist + ", blocked " + blocked + ", requesting " + unknownURL.size() + "/" + received + " URLs from " + otherPeerName, "", otherPeer.hash));
}
result = "ok";
@@ -254,6 +254,6 @@ public final class transferRWI {
* @param msg
*/
private static void logWarning(final String requestIdentifier, final String msg) {
- Log.logWarning("transferRWI", requestIdentifier +" "+ msg);
+ ConcurrentLog.warn("transferRWI", requestIdentifier +" "+ msg);
}
}
diff --git a/htroot/yacy/transferURL.java b/htroot/yacy/transferURL.java
index 908fe66b3..a010a64b8 100644
--- a/htroot/yacy/transferURL.java
+++ b/htroot/yacy/transferURL.java
@@ -36,10 +36,10 @@ import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.RSSMessage;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.crawler.data.ResultURLs.EventOrigin;
import net.yacy.kelondro.data.meta.URIMetadataRow;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.EventChannel;
import net.yacy.peers.Network;
import net.yacy.peers.Protocol;
@@ -79,10 +79,10 @@ public final class transferURL {
final String otherPeerName = iam + ":" + ((otherPeer == null) ? "NULL" : (otherPeer.getName() + "/" + otherPeer.getVersion()));
if ((youare == null) || (!youare.equals(sb.peers.mySeed().hash))) {
- Network.log.logInfo("Rejecting URLs from peer " + otherPeerName + ". Wrong target. Wanted peer=" + youare + ", iam=" + sb.peers.mySeed().hash);
+ Network.log.info("Rejecting URLs from peer " + otherPeerName + ". Wrong target. Wanted peer=" + youare + ", iam=" + sb.peers.mySeed().hash);
result = "wrong_target";
} else if ((!granted) || (sb.isRobinsonMode())) {
- Network.log.logInfo("Rejecting URLs from peer " + otherPeerName + ". Not granted.");
+ Network.log.info("Rejecting URLs from peer " + otherPeerName + ". Not granted.");
result = "error_not_granted";
} else {
int received = 0;
@@ -98,7 +98,7 @@ public final class transferURL {
// read new lurl-entry
urls = post.get("url" + i);
if (urls == null) {
- if (Network.log.isFine()) Network.log.logFine("transferURL: got null URL-string from peer " + otherPeerName);
+ if (Network.log.isFine()) Network.log.fine("transferURL: got null URL-string from peer " + otherPeerName);
blocked++;
continue;
}
@@ -106,28 +106,28 @@ public final class transferURL {
// parse new lurl-entry
lEntry = URIMetadataRow.importEntry(urls);
if (lEntry == null) {
- if (Network.log.isWarning()) Network.log.logWarning("transferURL: received invalid URL (entry null) from peer " + otherPeerName + "\n\tURL Property: " + urls);
+ if (Network.log.isWarn()) Network.log.warn("transferURL: received invalid URL (entry null) from peer " + otherPeerName + "\n\tURL Property: " + urls);
blocked++;
continue;
}
// check if entry is well-formed
if (lEntry.url() == null) {
- if (Network.log.isWarning()) Network.log.logWarning("transferURL: received invalid URL from peer " + otherPeerName + "\n\tURL Property: " + urls);
+ if (Network.log.isWarn()) Network.log.warn("transferURL: received invalid URL from peer " + otherPeerName + "\n\tURL Property: " + urls);
blocked++;
continue;
}
// check whether entry is too old
if (lEntry.freshdate().getTime() <= freshdate) {
- if (Network.log.isFine()) Network.log.logFine("transerURL: received too old URL from peer " + otherPeerName + ": " + lEntry.freshdate());
+ if (Network.log.isFine()) Network.log.fine("transerURL: received too old URL from peer " + otherPeerName + ": " + lEntry.freshdate());
blocked++;
continue;
}
// check if the entry is blacklisted
if ((blockBlacklist) && (Switchboard.urlBlacklist.isListed(BlacklistType.DHT, lEntry))) {
- if (Network.log.isFine()) Network.log.logFine("transferURL: blocked blacklisted URL '" + lEntry.url().toNormalform(false) + "' from peer " + otherPeerName);
+ if (Network.log.isFine()) Network.log.fine("transferURL: blocked blacklisted URL '" + lEntry.url().toNormalform(false) + "' from peer " + otherPeerName);
lEntry = null;
blocked++;
continue;
@@ -136,7 +136,7 @@ public final class transferURL {
// check if the entry is in our network domain
final String urlRejectReason = sb.crawlStacker.urlInAcceptedDomain(lEntry.url());
if (urlRejectReason != null) {
- if (Network.log.isFine()) Network.log.logFine("transferURL: blocked URL '" + lEntry.url() + "' (" + urlRejectReason + ") from peer " + otherPeerName);
+ if (Network.log.isFine()) Network.log.fine("transferURL: blocked URL '" + lEntry.url() + "' (" + urlRejectReason + ") from peer " + otherPeerName);
lEntry = null;
blocked++;
continue;
@@ -152,14 +152,14 @@ public final class transferURL {
lEntry = lEm.get(id);
// write entry to database
- if (Network.log.isFine()) Network.log.logFine("Accepting URL from peer " + otherPeerName + ": " + lEntry.url().toNormalform(true));
+ if (Network.log.isFine()) Network.log.fine("Accepting URL from peer " + otherPeerName + ": " + lEntry.url().toNormalform(true));
try {
sb.index.fulltext().putMetadata(lEntry);
ResultURLs.stack(ASCII.String(lEntry.url().hash()), lEntry.url().getHost(), iam.getBytes(), iam.getBytes(), EventOrigin.DHT_TRANSFER);
- if (Network.log.isFine()) Network.log.logFine("transferURL: received URL '" + lEntry.url().toNormalform(false) + "' from peer " + otherPeerName);
+ if (Network.log.isFine()) Network.log.fine("transferURL: received URL '" + lEntry.url().toNormalform(false) + "' from peer " + otherPeerName);
received++;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -167,10 +167,10 @@ public final class transferURL {
sb.peers.mySeed().incRU(received);
// return rewrite properties
- Network.log.logInfo("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs");
+ Network.log.info("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs");
EventChannel.channels(EventChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + ", blocked " + blocked + " URLs from peer " + otherPeerName, "", otherPeer.hash));
if (doublecheck > 0) {
- Network.log.logWarning("Received " + doublecheck + "/" + urlc + " double URLs from peer " + otherPeerName); // double should not happen because we demanded only documents which we do not have yet
+ Network.log.warn("Received " + doublecheck + "/" + urlc + " double URLs from peer " + otherPeerName); // double should not happen because we demanded only documents which we do not have yet
doublevalues = Integer.toString(doublecheck);
}
result = "ok";
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 0414d819c..5ce298557 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -54,6 +54,7 @@ import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.DidYouMean;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkTables;
@@ -63,7 +64,6 @@ import net.yacy.document.LibraryProvider;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.Formatter;
import net.yacy.kelondro.util.ISO639;
@@ -164,7 +164,7 @@ public class yacysearch {
prop.put("topmenu_resource-select", stealthmode ? 2 : global ? 1 : 0);
if ( post == null || indexSegment == null || env == null || !searchAllowed ) {
- if (indexSegment == null) Log.logInfo("yacysearch", "indexSegment == null");
+ if (indexSegment == null) ConcurrentLog.info("yacysearch", "indexSegment == null");
// we create empty entries for template strings
prop.put("searchagain", "0");
prop.put("former", "");
@@ -289,11 +289,11 @@ public class yacysearch {
snippetFetchStrategy = null;
}
block = true;
- Log.logWarning("LOCAL_SEARCH", "ACCESS CONTROL: BLACKLISTED CLIENT FROM "
+ ConcurrentLog.warn("LOCAL_SEARCH", "ACCESS CONTROL: BLACKLISTED CLIENT FROM "
+ client
+ " gets no permission to search");
} else if ( Domains.matchesList(client, sb.networkWhitelist) ) {
- Log.logInfo("LOCAL_SEARCH", "ACCESS CONTROL: WHITELISTED CLIENT FROM "
+ ConcurrentLog.info("LOCAL_SEARCH", "ACCESS CONTROL: WHITELISTED CLIENT FROM "
+ client
+ " gets no search restrictions");
} else if ( !authenticated && !localhostAccess && !intranetMode ) {
@@ -309,7 +309,7 @@ public class yacysearch {
if ( global ) {
if ( accInTenMinutes >= 60 || accInOneMinute >= 6 || accInThreeSeconds >= 1 ) {
global = false;
- Log.logWarning("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM "
+ ConcurrentLog.warn("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM "
+ client
+ ": "
+ accInThreeSeconds
@@ -325,7 +325,7 @@ public class yacysearch {
if ( snippetFetchStrategy != null && snippetFetchStrategy.isAllowedToFetchOnline() ) {
if ( accInTenMinutes >= 20 || accInOneMinute >= 4 || accInThreeSeconds >= 1 ) {
snippetFetchStrategy = CacheStrategy.CACHEONLY;
- Log.logWarning("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM "
+ ConcurrentLog.warn("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM "
+ client
+ ": "
+ accInThreeSeconds
@@ -340,7 +340,7 @@ public class yacysearch {
// general load protection
if ( accInTenMinutes >= 3000 || accInOneMinute >= 600 || accInThreeSeconds >= 60 ) {
block = true;
- Log.logWarning("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM "
+ ConcurrentLog.warn("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM "
+ client
+ ": "
+ accInThreeSeconds
@@ -560,7 +560,7 @@ public class yacysearch {
// delete the search history since this still shows the entry
SearchEventCache.delete(delHash);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -626,7 +626,7 @@ public class yacysearch {
try {
Pattern.compile(urlmask);
} catch ( final PatternSyntaxException ex ) {
- SearchEvent.log.logWarning("Illegal URL mask, not a valid regex: " + urlmask);
+ SearchEvent.log.warn("Illegal URL mask, not a valid regex: " + urlmask);
prop.put("urlmaskerror", 1);
prop.putHTML("urlmaskerror_urlmask", urlmask);
urlmask = ".*";
@@ -635,7 +635,7 @@ public class yacysearch {
try {
Pattern.compile(prefermask);
} catch ( final PatternSyntaxException ex ) {
- SearchEvent.log.logWarning("Illegal prefer mask, not a valid regex: " + prefermask);
+ SearchEvent.log.warn("Illegal prefer mask, not a valid regex: " + prefermask);
prop.put("prefermaskerror", 1);
prop.putHTML("prefermaskerror_prefermask", prefermask);
prefermask = "";
@@ -685,7 +685,7 @@ public class yacysearch {
theQuery.getQueryGoal().filterOut(Switchboard.blueList);
// log
- Log.logInfo(
+ ConcurrentLog.info(
"LOCAL_SEARCH",
"INIT WORD SEARCH: "
+ theQuery.getQueryGoal().getOriginalQueryString(false)
@@ -738,7 +738,7 @@ public class yacysearch {
}
// log
- Log.logInfo("LOCAL_SEARCH", "EXIT WORD SEARCH: "
+ ConcurrentLog.info("LOCAL_SEARCH", "EXIT WORD SEARCH: "
+ theQuery.getQueryGoal().getOriginalQueryString(false)
+ " - "
+ "local_rwi_available(" + theSearch.local_rwi_available.get() + "), "
@@ -830,7 +830,7 @@ public class yacysearch {
sb.localSearchTracker.clear();
}
} catch ( final Exception e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
prop.put("num-results_offset", startRecord == 0 ? 0 : startRecord + 1);
diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java
index 707eda9a9..c9adc6f5d 100644
--- a/htroot/yacysearchitem.java
+++ b/htroot/yacysearchitem.java
@@ -38,10 +38,10 @@ import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.RequestHeader.FileType;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.data.URLLicense;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Formatter;
import net.yacy.peers.NewsPool;
import net.yacy.peers.Seed;
@@ -124,7 +124,7 @@ public class yacysearchitem {
if ((fileType == FileType.HTML || fileType == FileType.JSON) && !sb.isIntranetMode()) try {
faviconURL = new DigestURI(resultURL.getProtocol() + "://" + resultURL.getHost() + ((port != -1) ? (":" + port) : "") + "/favicon.ico");
} catch (final MalformedURLException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
faviconURL = null;
}
final String resource = theSearch.query.domType.toString();
diff --git a/source/net/yacy/contentcontrol/SMWListImporter.java b/source/net/yacy/contentcontrol/SMWListImporter.java
index 500c0b625..2fa092913 100644
--- a/source/net/yacy/contentcontrol/SMWListImporter.java
+++ b/source/net/yacy/contentcontrol/SMWListImporter.java
@@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.Map.Entry;
import java.util.concurrent.ArrayBlockingQueue;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.json.simple.parser.ContentHandler;
import org.json.simple.parser.JSONParser;
@@ -88,7 +88,7 @@ public class SMWListImporter implements Runnable, ContentHandler{
this.listEntries.put(this.row);
//this.count++;
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.obj.clear();
this.row = new SMWListRow();
@@ -134,20 +134,20 @@ public class SMWListImporter implements Runnable, ContentHandler{
@Override
public void run() {
try {
- Log.logInfo("SMWLISTSYNC", "Importer run()");
+ ConcurrentLog.info("SMWLISTSYNC", "Importer run()");
this.parser.parse(this.importFile, this, true);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (ParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {
- Log.logInfo("SMWLISTSYNC", "Importer inserted poison pill in queue");
+ ConcurrentLog.info("SMWLISTSYNC", "Importer inserted poison pill in queue");
this.listEntries.put(SMWListRow.POISON);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -156,7 +156,7 @@ public class SMWListImporter implements Runnable, ContentHandler{
try {
return this.listEntries.take();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/contentcontrol/SMWListImporterFormatObsolete.java b/source/net/yacy/contentcontrol/SMWListImporterFormatObsolete.java
index 45804c45e..b41d6703d 100644
--- a/source/net/yacy/contentcontrol/SMWListImporterFormatObsolete.java
+++ b/source/net/yacy/contentcontrol/SMWListImporterFormatObsolete.java
@@ -5,7 +5,7 @@ import java.io.Reader;
import java.util.Iterator;
import java.util.concurrent.ArrayBlockingQueue;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
@@ -29,7 +29,7 @@ public class SMWListImporterFormatObsolete implements Runnable{
@Override
public void run() {
try {
- Log.logInfo("SMWLISTSYNC", "Importer run()");
+ ConcurrentLog.info("SMWLISTSYNC", "Importer run()");
Object obj = this.parser.parse(this.importFile);
JSONObject jsonObject = (JSONObject) obj;
@@ -43,16 +43,16 @@ public class SMWListImporterFormatObsolete implements Runnable{
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (ParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {
- Log.logInfo("SMWLISTSYNC", "Importer inserted poison pill in queue");
+ ConcurrentLog.info("SMWLISTSYNC", "Importer inserted poison pill in queue");
this.listEntries.put(SMWListRow.POISON);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -82,7 +82,7 @@ public class SMWListImporterFormatObsolete implements Runnable{
this.listEntries.put(row);
} catch (Exception e) {
- Log.logInfo("SMWLISTSYNC", "import of entry failed");
+ ConcurrentLog.info("SMWLISTSYNC", "import of entry failed");
}
}
@@ -110,7 +110,7 @@ public class SMWListImporterFormatObsolete implements Runnable{
try {
return this.listEntries.take();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/contentcontrol/SMWListSyncThread.java b/source/net/yacy/contentcontrol/SMWListSyncThread.java
index 0d2f6feac..f30501f78 100644
--- a/source/net/yacy/contentcontrol/SMWListSyncThread.java
+++ b/source/net/yacy/contentcontrol/SMWListSyncThread.java
@@ -8,7 +8,7 @@ import java.net.URL;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.http.HTTPClient;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
public class SMWListSyncThread {
@@ -85,7 +85,7 @@ public class SMWListSyncThread {
this.currentmax = Integer.parseInt(overallcount);
if (this.currentmax > 0) {
- Log.logInfo("SMWLISTSYNC",
+ ConcurrentLog.info("SMWLISTSYNC",
"import job counts "
+ this.currentmax
+ " new elements between "
@@ -99,7 +99,7 @@ public class SMWListSyncThread {
this.offset = 0;
}
} else {
- Log.logWarning("SMWLISTSYNC",
+ ConcurrentLog.warn("SMWLISTSYNC",
"No SMWimport URL defined");
}
} catch (MalformedURLException e) {
@@ -114,7 +114,7 @@ public class SMWListSyncThread {
} else {
// there are new elements to be imported
- Log.logInfo("SMWLISTSYNC",
+ ConcurrentLog.info("SMWLISTSYNC",
"importing max. " + this.limit
+ " elements at " + this.offset + " of "
+ this.currentmax + ", since "
@@ -146,7 +146,7 @@ public class SMWListSyncThread {
reader = new InputStreamReader(
urlImport.openStream(), "UTF-8");
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.runningjob = false;
}
@@ -157,7 +157,7 @@ public class SMWListSyncThread {
reader, 200);
} catch (final Exception e) {
// TODO: display an error message
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.runningjob = false;
}
Thread t;
diff --git a/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java b/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java
index 73f09f6a2..a37549de8 100644
--- a/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java
+++ b/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java
@@ -29,10 +29,10 @@ import java.util.Set;
import net.yacy.cora.federate.solr.connector.SolrConnector;
import net.yacy.cora.storage.Configuration;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.document.parser.xml.opensearchdescriptionReader;
import net.yacy.kelondro.blob.Tables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.query.SearchEvent;
@@ -79,13 +79,13 @@ public class OpenSearchConnector {
try {
sb.tables.insert("opensearchsys", row);
} catch (SpaceExceededException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
}
}
size = sb.tables.size("opensearchsys");
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
}
}
@@ -112,7 +112,7 @@ public class OpenSearchConnector {
sb.heuristicRSS(parseSearchTemplate(osurl, "$", 0, theSearch.query.itemsPerPage), theSearch, "opensearch:" + name);
}
} catch (IOException ex) {
- Log.logWarning("OpenSearchConnector.query", "failed reading table opensearchsys");
+ ConcurrentLog.warn("OpenSearchConnector.query", "failed reading table opensearchsys");
}
}
}
@@ -152,12 +152,12 @@ public class OpenSearchConnector {
try {
conf.commit();
} catch (IOException ex) {
- Log.logWarning("OpenSearchConnector.add", "config file write error");
+ ConcurrentLog.warn("OpenSearchConnector.add", "config file write error");
}
return true;
}
} catch (IOException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
return false;
}
return false;
@@ -184,14 +184,14 @@ public class OpenSearchConnector {
final SolrConnector connector = sb.index.fulltext().getWebgraphConnector();
// check if needed Solr fields are available (selected)
if (connector == null) {
- Log.logSevere("OpenSearchConnector.Discover", "Error on connecting to embedded Solr webgraph index");
+ ConcurrentLog.severe("OpenSearchConnector.Discover", "Error on connecting to embedded Solr webgraph index");
return false;
}
final boolean metafieldavailable = sb.index.fulltext().getWebgraphConfiguration().contains(WebgraphSchema.target_rel_s.name())
&& ( sb.index.fulltext().getWebgraphConfiguration().contains(WebgraphSchema.target_protocol_s.name()) && sb.index.fulltext().getWebgraphConfiguration().contains(WebgraphSchema.target_urlstub_s.name()) )
&& sb.getConfigBool(SwitchboardConstants.CORE_SERVICE_WEBGRAPH, false);
if (!metafieldavailable) {
- Log.logWarning("OpenSearchConnector.Discover", "webgraph option and webgraph Schema fields target_rel_s, target_protocol_s and target_urlstub_s must be switched on");
+ ConcurrentLog.warn("OpenSearchConnector.Discover", "webgraph option and webgraph Schema fields target_rel_s, target_protocol_s and target_urlstub_s must be switched on");
return false;
}
// the solr query
@@ -204,12 +204,12 @@ public class OpenSearchConnector {
SolrDocumentList docList = connector.getDocumentListByQuery(webgraphquerystr, 0, 1, webgraphqueryfields);
numfound = docList.getNumFound();
if (numfound == 0) {
- Log.logInfo("OpenSearchConnector.Discover", "no results found, abort discover job");
+ ConcurrentLog.info("OpenSearchConnector.Discover", "no results found, abort discover job");
return true;
}
- Log.logInfo("OpenSearchConnector.Discover", "start checking " + Long.toString(numfound) + " found index results");
+ ConcurrentLog.info("OpenSearchConnector.Discover", "start checking " + Long.toString(numfound) + " found index results");
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
return false;
}
@@ -225,12 +225,12 @@ public class OpenSearchConnector {
int loopnr = 0;
Set<String> dblmem = new HashSet<String>(); // temp memory for already checked url
while (doloop) {
- Log.logInfo("OpenSearchConnector.Discover", "start Solr query loop at " + Integer.toString(loopnr * 20) + " of " + Long.toString(numfound));
+ ConcurrentLog.info("OpenSearchConnector.Discover", "start Solr query loop at " + Integer.toString(loopnr * 20) + " of " + Long.toString(numfound));
SolrDocumentList docList = connector.getDocumentListByQuery(webgraphquerystr, loopnr * 20, 20,webgraphqueryfields); // check chunk of 20 result documents
loopnr++;
if (stoptime < System.currentTimeMillis()) {// stop after max 1h
doloop = false;
- Log.logInfo("OpenSearchConnector.Discover", "long running discover task aborted");
+ ConcurrentLog.info("OpenSearchConnector.Discover", "long running discover task aborted");
}
if (docList != null && docList.size() > 0) {
Iterator<SolrDocument> docidx = docList.iterator();
@@ -246,9 +246,9 @@ public class OpenSearchConnector {
if (os.getRSSorAtomUrl() != null) {
// add found system to config file
add(os.getShortName(), os.getRSSorAtomUrl(), false, os.getItem("LongName"));
- Log.logInfo("OpenSearchConnector.Discover", "added " + os.getShortName() + " " + hrefurltxt);
+ ConcurrentLog.info("OpenSearchConnector.Discover", "added " + os.getShortName() + " " + hrefurltxt);
} else {
- Log.logInfo("OpenSearchConnector.Discover", "osd.xml check failed (no RSS or Atom support) for " + hrefurltxt);
+ ConcurrentLog.info("OpenSearchConnector.Discover", "osd.xml check failed (no RSS or Atom support) for " + hrefurltxt);
}
}
} catch (MalformedURLException ex) {
@@ -258,9 +258,9 @@ public class OpenSearchConnector {
doloop = false;
}
}
- Log.logInfo("OpenSearchConnector.Discover", "finisched Solr query (checked " + Integer.toString(dblmem.size()) + " unique opensearchdescription links found in " + Long.toString(numfound) + " results)");
+ ConcurrentLog.info("OpenSearchConnector.Discover", "finisched Solr query (checked " + Integer.toString(dblmem.size()) + " unique opensearchdescription links found in " + Long.toString(numfound) + " results)");
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
}
};
diff --git a/source/net/yacy/cora/federate/solr/connector/ConcurrentUpdateSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/ConcurrentUpdateSolrConnector.java
index 47c74254a..1e014f92c 100644
--- a/source/net/yacy/cora/federate/solr/connector/ConcurrentUpdateSolrConnector.java
+++ b/source/net/yacy/cora/federate/solr/connector/ConcurrentUpdateSolrConnector.java
@@ -33,10 +33,10 @@ import java.util.concurrent.LinkedBlockingQueue;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.search.schema.CollectionSchema;
@@ -72,11 +72,11 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
ConcurrentUpdateSolrConnector.this.connector.deleteById(id);
ConcurrentUpdateSolrConnector.this.idCache.remove(ASCII.getBytes(id));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -91,11 +91,11 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
updateIdCache((String) doc.getFieldValue(CollectionSchema.id.getSolrFieldName()));
ConcurrentUpdateSolrConnector.this.connector.add(doc);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -301,7 +301,7 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
ConcurrentUpdateSolrConnector.this.connector.deleteByQuery(querystring);
ConcurrentUpdateSolrConnector.this.idCache.clear();
} catch (IOException e) {
- Log.logSevere("ConcurrentUpdateSolrConnector", e.getMessage(), e);
+ ConcurrentLog.severe("ConcurrentUpdateSolrConnector", e.getMessage(), e);
}
ConcurrentUpdateSolrConnector.this.connector.commit(true);
}
diff --git a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java
index 8b6310a36..c11dde6b3 100644
--- a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java
+++ b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java
@@ -26,7 +26,7 @@ import java.util.List;
import net.yacy.cora.federate.solr.instance.EmbeddedInstance;
import net.yacy.cora.federate.solr.instance.SolrInstance;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
@@ -142,9 +142,9 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
@Override
public synchronized void close() {
- try {this.commit(false);} catch (Throwable e) {Log.logException(e);}
- try {super.close();} catch (Throwable e) {Log.logException(e);}
- try {this.core.close();} catch (Throwable e) {Log.logException(e);}
+ try {this.commit(false);} catch (Throwable e) {ConcurrentLog.logException(e);}
+ try {super.close();} catch (Throwable e) {ConcurrentLog.logException(e);}
+ try {this.core.close();} catch (Throwable e) {ConcurrentLog.logException(e);}
}
public SolrQueryRequest request(final SolrParams params) {
diff --git a/source/net/yacy/cora/federate/solr/connector/ShardSelection.java b/source/net/yacy/cora/federate/solr/connector/ShardSelection.java
index 141966b57..860f9eaec 100644
--- a/source/net/yacy/cora/federate/solr/connector/ShardSelection.java
+++ b/source/net/yacy/cora/federate/solr/connector/ShardSelection.java
@@ -28,7 +28,7 @@ import java.security.NoSuchAlgorithmException;
import java.util.concurrent.atomic.AtomicLong;
import net.yacy.cora.document.ASCII;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.schema.CollectionSchema;
import org.apache.solr.common.SolrInputDocument;
@@ -66,7 +66,7 @@ public class ShardSelection {
try {
return selectURL(url);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return 0;
}
}
diff --git a/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java b/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java
index aa3c919ef..341d43437 100644
--- a/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java
+++ b/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java
@@ -26,7 +26,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.schema.CollectionSchema;
import org.apache.log4j.Logger;
@@ -85,7 +85,7 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
try {
this.server.optimize(true, true, maxSegments);
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -97,7 +97,7 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
if (this.server instanceof EmbeddedSolrServer) synchronized (this.server) {this.server.commit(true, true, false);}
this.server = null;
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -199,27 +199,27 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
if (solrdoc.containsKey("_version_")) solrdoc.setField("_version_",0L); // prevent Solr "version conflict"
this.server.add(solrdoc, -1);
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
// catches "version conflict for": try this again and delete the document in advance
try {
this.server.deleteById((String) solrdoc.getFieldValue(CollectionSchema.id.getSolrFieldName()));
} catch (SolrServerException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
try {
this.server.add(solrdoc, -1);
} catch (Throwable ee) {
- Log.logException(ee);
+ ConcurrentLog.logException(ee);
try {
this.server.commit();
} catch (Throwable eee) {
- Log.logException(eee);
+ ConcurrentLog.logException(eee);
// a time-out may occur here
}
try {
this.server.add(solrdoc, -1);
} catch (Throwable eee) {
- Log.logException(eee);
+ ConcurrentLog.logException(eee);
throw new IOException(eee);
}
}
@@ -237,25 +237,25 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
}
this.server.add(solrdocs, -1);
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
// catches "version conflict for": try this again and delete the document in advance
List<String> ids = new ArrayList<String>();
for (SolrInputDocument solrdoc : solrdocs) ids.add((String) solrdoc.getFieldValue(CollectionSchema.id.getSolrFieldName()));
try {
this.server.deleteById(ids);
} catch (SolrServerException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
try {
this.server.commit();
} catch (Throwable eee) {
- Log.logException(eee);
+ ConcurrentLog.logException(eee);
// a time-out may occur here
}
try {
this.server.add(solrdocs, -1);
} catch (Throwable ee) {
- Log.logException(ee);
+ ConcurrentLog.logException(ee);
log.warn(e.getMessage() + " IDs=" + ids.toString());
throw new IOException(ee);
}
diff --git a/source/net/yacy/cora/federate/solr/instance/EmbeddedInstance.java b/source/net/yacy/cora/federate/solr/instance/EmbeddedInstance.java
index 872af73a6..b22e58285 100644
--- a/source/net/yacy/cora/federate/solr/instance/EmbeddedInstance.java
+++ b/source/net/yacy/cora/federate/solr/instance/EmbeddedInstance.java
@@ -26,7 +26,7 @@ import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
import org.apache.solr.client.solrj.SolrServer;
@@ -85,7 +85,7 @@ public class EmbeddedInstance implements SolrInstance {
// get the default core from the coreContainer
this.defaultCoreName = this.coreContainer.getDefaultCoreName();
assert(this.defaultCoreName.equals(givenDefaultCoreName));
- Log.logInfo("SolrEmbeddedInstance", "detected default solr core: " + this.defaultCoreName);
+ ConcurrentLog.info("SolrEmbeddedInstance", "detected default solr core: " + this.defaultCoreName);
this.defaultCore = this.coreContainer.getCore(this.defaultCoreName);
assert givenDefaultCoreName.equals(this.defaultCore.getName()) : "givenDefaultCoreName = " + givenDefaultCoreName + ", this.defaultCore.getName() = " + this.defaultCore.getName();
if (this.defaultCore == null) {
@@ -154,7 +154,7 @@ public class EmbeddedInstance implements SolrInstance {
if (source.exists()) {
try {
Files.copy(source, target);
- Log.logFine("initializeCoreConf", "overwrite " + target.getAbsolutePath() + " with " + source.getAbsolutePath());
+ ConcurrentLog.fine("initializeCoreConf", "overwrite " + target.getAbsolutePath() + " with " + source.getAbsolutePath());
} catch (IOException ex) {
ex.printStackTrace();
}
@@ -204,7 +204,7 @@ public class EmbeddedInstance implements SolrInstance {
@Override
public synchronized void close() {
- try {this.coreContainer.shutdown();} catch (Throwable e) {Log.logException(e);}
+ try {this.coreContainer.shutdown();} catch (Throwable e) {ConcurrentLog.logException(e);}
}
}
diff --git a/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java b/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java
index 65f99995b..a4f3b8fea 100644
--- a/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java
+++ b/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java
@@ -30,7 +30,7 @@ import java.util.Map;
import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.protocol.Domains;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.schema.CollectionSchema;
import net.yacy.search.schema.WebgraphSchema;
@@ -231,10 +231,10 @@ public class RemoteInstance implements SolrInstance {
int port = u.getPort();
String solrpath = u.getPath();
String p = "http://" + host + ":" + port + solrpath;
- Log.logInfo("RemoteSolrConnector", "connecting Solr authenticated with url:" + p);
+ ConcurrentLog.info("RemoteSolrConnector", "connecting Solr authenticated with url:" + p);
s = new HttpSolrServer(p, client);
} else {
- Log.logInfo("RemoteSolrConnector", "connecting Solr with url:" + this.solrurl + name);
+ ConcurrentLog.info("RemoteSolrConnector", "connecting Solr with url:" + this.solrurl + name);
s = new HttpSolrServer(this.solrurl + name);
}
s.setAllowCompression(true);
diff --git a/source/net/yacy/cora/geo/OpenGeoDBLocation.java b/source/net/yacy/cora/geo/OpenGeoDBLocation.java
index 92f820646..5cc7a1dc2 100644
--- a/source/net/yacy/cora/geo/OpenGeoDBLocation.java
+++ b/source/net/yacy/cora/geo/OpenGeoDBLocation.java
@@ -40,8 +40,8 @@ import java.util.TreeSet;
import java.util.zip.GZIPInputStream;
import net.yacy.cora.document.WordCache;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.StringBuilderComparator;
-import net.yacy.kelondro.logging.Log;
/**
* this class loads and parses database dumps from the OpenGeoDB project files can be loaded from
@@ -163,7 +163,7 @@ public class OpenGeoDBLocation implements Locations
}
reader.close();
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
if ( reader != null ) {
try {
diff --git a/source/net/yacy/cora/protocol/ftp/FTPClient.java b/source/net/yacy/cora/protocol/ftp/FTPClient.java
index 8a00cf9e5..ebaaa978f 100644
--- a/source/net/yacy/cora/protocol/ftp/FTPClient.java
+++ b/source/net/yacy/cora/protocol/ftp/FTPClient.java
@@ -7,10 +7,6 @@
* added html generation for directories: 5.9.2006
* migrated to the cora package and re-licensed under lgpl: 23.08.2010
*
- * $LastChangedDate$
- * $LastChangedRevision$
- * $LastChangedBy$
- *
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or
@@ -71,13 +67,11 @@ import java.util.regex.Pattern;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.Domains;
-import net.yacy.kelondro.logging.Log;
-
-import org.apache.log4j.Logger;
+import net.yacy.cora.util.ConcurrentLog;
public class FTPClient {
- private static Logger log = Logger.getLogger(FTPClient.class);
+ private static ConcurrentLog log = new ConcurrentLog("FTPClient");
private static final String vDATE = "20100823";
@@ -174,14 +168,14 @@ public class FTPClient {
if (notConnected()) {
// the error was probably caused because there is no
// connection
- log.error("not connected. no effect.", e);
+ log.warn("not connected. no effect.", e);
} else {
- log.error("ftp internal exception: target exception " + e);
+ log.warn("ftp internal exception: target exception " + e);
}
return ret;
}
} catch (final IllegalAccessException e) {
- log.error("ftp internal exception: wrong access " + e);
+ log.warn("ftp internal exception: wrong access " + e);
return ret;
} catch (final NoSuchMethodException e) {
// consider first that the user attempted to execute a java
@@ -192,7 +186,7 @@ public class FTPClient {
try {
javaexec(this.cmd);
} catch (final Exception ee) {
- log.error("Command '" + this.cmd[0] + "' not supported. Try 'HELP'.");
+ log.warn("Command '" + this.cmd[0] + "' not supported. Try 'HELP'.");
}
} else {
// try a remote exec
@@ -292,7 +286,7 @@ public class FTPClient {
// pr.put("java.class.path", "" + pr.get("user.dir") +
// pr.get("path.separator") + origPath);
- // log.error("System Properties: " + pr.toString());
+ // log.warning("System Properties: " + pr.toString());
System.setProperties(pr);
@@ -319,31 +313,31 @@ public class FTPClient {
this.currentLocalPath = new File((String) pr.get("user.dir"));
} catch (final ClassNotFoundException e) {
- // log.error("cannot find class file " + obj +
+ // log.warning("cannot find class file " + obj +
// ".class");
// class file does not exist, go silently over it to not show
// everybody that the
// system attempted to load a class file
- log.error("Command '" + obj + "' not supported. Try 'HELP'.");
+ log.warn("Command '" + obj + "' not supported. Try 'HELP'.");
} catch (final NoSuchMethodException e) {
- log.error("no \"public static main(String args[])\" in " + obj);
+ log.warn("no \"public static main(String args[])\" in " + obj);
} catch (final InvocationTargetException e) {
final Throwable orig = e.getTargetException();
if (orig.getMessage() != null) {
- log.error("Exception from " + obj + ": " + orig.getMessage(), orig);
+ log.warn("Exception from " + obj + ": " + orig.getMessage(), orig);
}
} catch (final IllegalAccessException e) {
- log.error("Illegal access for " + obj + ": class is probably not declared as public", e);
+ log.warn("Illegal access for " + obj + ": class is probably not declared as public", e);
} catch (final NullPointerException e) {
- log.error("main(String args[]) is not defined as static for " + obj);
+ log.warn("main(String args[]) is not defined as static for " + obj);
/*
* } catch (IOException e) { // class file does not exist, go
* silently over it to not show everybody that the // system
- * attempted to load a class file log.error("Command '" + obj + "'
+ * attempted to load a class file log.warning("Command '" + obj + "'
* not supported. Try 'HELP'.");
*/
} catch (final Exception e) {
- log.error("Exception caught: ", e);
+ log.warn("Exception caught: ", e);
}
// set the classpath to its original definition
@@ -355,26 +349,26 @@ public class FTPClient {
public boolean ASCII() {
if (this.cmd.length != 1) {
- log.error("Syntax: ASCII (no parameter)");
+ log.warn("Syntax: ASCII (no parameter)");
return true;
}
try {
literal("TYPE A");
} catch (final IOException e) {
- log.error("Error: ASCII transfer type not supported by server.");
+ log.warn("Error: ASCII transfer type not supported by server.");
}
return true;
}
public boolean BINARY() {
if (this.cmd.length != 1) {
- log.error("Syntax: BINARY (no parameter)");
+ log.warn("Syntax: BINARY (no parameter)");
return true;
}
try {
literal("TYPE I");
} catch (final IOException e) {
- log.error("Error: BINARY transfer type not supported by server.");
+ log.warn("Error: BINARY transfer type not supported by server.");
}
return true;
}
@@ -385,7 +379,7 @@ public class FTPClient {
public boolean CD() {
if (this.cmd.length != 2) {
- log.error("Syntax: CD <path>");
+ log.warn("Syntax: CD <path>");
return true;
}
if (notConnected()) {
@@ -400,7 +394,7 @@ public class FTPClient {
throw new IOException(reply);
}
} catch (final IOException e) {
- log.error("Error: change of working directory to path " + this.cmd[1] + " failed.");
+ log.warn("Error: change of working directory to path " + this.cmd[1] + " failed.");
}
return true;
}
@@ -445,7 +439,7 @@ public class FTPClient {
public boolean DEL() {
if (this.cmd.length != 2) {
- log.error("Syntax: DEL <file>");
+ log.warn("Syntax: DEL <file>");
return true;
}
if (notConnected()) {
@@ -454,7 +448,7 @@ public class FTPClient {
try {
rmForced(this.cmd[1]);
} catch (final IOException e) {
- log.error("Error: deletion of file " + this.cmd[1] + " failed.");
+ log.warn("Error: deletion of file " + this.cmd[1] + " failed.");
}
return true;
}
@@ -465,7 +459,7 @@ public class FTPClient {
public boolean DIR() {
if (this.cmd.length > 2) {
- log.error("Syntax: DIR [<path>|<file>]");
+ log.warn("Syntax: DIR [<path>|<file>]");
return true;
}
if (notConnected()) {
@@ -480,7 +474,7 @@ public class FTPClient {
}
printElements(l);
} catch (final IOException e) {
- log.error("Error: remote list not available (1): " + e.getMessage());
+ log.warn("Error: remote list not available (1): " + e.getMessage());
}
return true;
}
@@ -528,7 +522,7 @@ public class FTPClient {
public boolean GET() {
if ((this.cmd.length < 2) || (this.cmd.length > 3)) {
- log.error("Syntax: GET <remote-file> [<local-file>]");
+ log.warn("Syntax: GET <remote-file> [<local-file>]");
return true;
}
final String remote = this.cmd[1]; // (new File(cmd[1])).getName();
@@ -538,7 +532,7 @@ public class FTPClient {
final File local = absoluteLocalFile(localFilename);
if (local.exists()) {
- log.error("Error: local file " + local.toString() + " already exists.\n" + " File " + remote
+ log.warn("Error: local file " + local.toString() + " already exists.\n" + " File " + remote
+ " not retrieved. Local file unchanged.");
} else {
if (withoutLocalFile) {
@@ -547,7 +541,7 @@ public class FTPClient {
try {
get(local.getAbsolutePath(), remote);
} catch (final IOException e) {
- log.error("Error: retrieving file " + remote + " failed. (" + e.getMessage() + ")");
+ log.warn("Error: retrieving file " + remote + " failed. (" + e.getMessage() + ")");
}
}
}
@@ -578,7 +572,7 @@ public class FTPClient {
rmForced(remote);
}
} catch (final IOException eee) {
- log.error("Warning: remote file or path " + remote + " cannot be removed.");
+ log.warn("Warning: remote file or path " + remote + " cannot be removed.");
}
} catch (final IOException e) {
if (e.getMessage().startsWith("550")) {
@@ -601,13 +595,13 @@ public class FTPClient {
rmForced(remote);
}
} catch (final IOException eee) {
- log.error("Warning: remote file or path " + remote + " cannot be removed.");
+ log.warn("Warning: remote file or path " + remote + " cannot be removed.");
}
} else {
- log.error("Error: remote file or path " + remote + " does not exist.");
+ log.warn("Error: remote file or path " + remote + " does not exist.");
}
} else {
- log.error("Error: retrieving file " + remote + " failed. (" + e.getMessage() + ")");
+ log.warn("Error: retrieving file " + remote + " failed. (" + e.getMessage() + ")");
}
}
}
@@ -652,7 +646,7 @@ public class FTPClient {
public boolean GLOB() {
if (this.cmd.length != 1) {
- log.error("Syntax: GLOB (no parameter)");
+ log.warn("Syntax: GLOB (no parameter)");
return true;
}
this.glob = !this.glob;
@@ -661,7 +655,7 @@ public class FTPClient {
}
public boolean HASH() {
- log.error("no games implemented");
+ log.warn("no games implemented");
return true;
}
@@ -676,7 +670,7 @@ public class FTPClient {
public boolean JJENCODE() {
if (this.cmd.length != 2) {
- log.error("Syntax: JJENCODE <path>");
+ log.warn("Syntax: JJENCODE <path>");
return true;
}
final String path = this.cmd[1];
@@ -701,17 +695,17 @@ public class FTPClient {
exec("cd ..;jar -cfM \"" + path + ".jj\" \"" + path + ".jar\"", true);
exec("rm \"" + path + ".jar\"", true);
} else {
- log.error("Error: local path " + newPath.toString() + " denotes not to a directory.");
+ log.warn("Error: local path " + newPath.toString() + " denotes not to a directory.");
}
} else {
- log.error("Error: local path " + newPath.toString() + " does not exist.");
+ log.warn("Error: local path " + newPath.toString() + " does not exist.");
}
return true;
}
public boolean JJDECODE() {
if (this.cmd.length != 2) {
- log.error("Syntax: JJENCODE <path>");
+ log.warn("Syntax: JJENCODE <path>");
return true;
}
final String path = this.cmd[1];
@@ -730,13 +724,13 @@ public class FTPClient {
exec("mkdir \"" + path + ".dir\"", true);
} else {
- log.error("Error: target dir " + newFolder.toString() + " cannot be created");
+ log.warn("Error: target dir " + newFolder.toString() + " cannot be created");
}
} else {
- log.error("Error: local path " + newPath.toString() + " must denote to jar/jar file");
+ log.warn("Error: local path " + newPath.toString() + " must denote to jar/jar file");
}
} else {
- log.error("Error: local path " + newPath.toString() + " does not exist.");
+ log.warn("Error: local path " + newPath.toString() + " does not exist.");
}
return true;
}
@@ -751,7 +745,7 @@ public class FTPClient {
final String dest_name = args[1];
final File dest_file = new File(dest_name);
if (dest_file.exists()) {
- log.error("join: destination file " + dest_name + " already exists");
+ log.warn("join: destination file " + dest_name + " already exists");
return true;
}
@@ -817,10 +811,10 @@ public class FTPClient {
for (pc = 0; pc < args.length; pc++) {
try {
if (!(new File(args[pc])).delete()) {
- log.error("join: unable to delete file " + args[pc]);
+ log.warn("join: unable to delete file " + args[pc]);
}
} catch (final SecurityException e) {
- log.error("join: no permission to delete file " + args[pc]);
+ log.warn("join: no permission to delete file " + args[pc]);
}
}
} catch (final FileNotFoundException e) {
@@ -844,7 +838,7 @@ public class FTPClient {
}
// print appropriate message
- log.error("join created output from " + args.length + " source files");
+ log.warn("join created output from " + args.length + " source files");
}
return true;
}
@@ -852,7 +846,7 @@ public class FTPClient {
public boolean COPY(final String[] args) {
final File dest_file = new File(args[2]);
if (dest_file.exists()) {
- log.error("copy: destination file " + args[2] + " already exists");
+ log.warn("copy: destination file " + args[2] + " already exists");
return true;
}
int bytes_read = 0;
@@ -913,7 +907,7 @@ public class FTPClient {
public boolean LCD() {
if (this.cmd.length != 2) {
- log.error("Syntax: LCD <path>");
+ log.warn("Syntax: LCD <path>");
return true;
}
final String path = this.cmd[1];
@@ -928,10 +922,10 @@ public class FTPClient {
this.currentLocalPath = newPath;
log.info("---- New local path: " + this.currentLocalPath.toString());
} else {
- log.error("Error: local path " + newPath.toString() + " denotes not a directory.");
+ log.warn("Error: local path " + newPath.toString() + " denotes not a directory.");
}
} else {
- log.error("Error: local path " + newPath.toString() + " does not exist.");
+ log.warn("Error: local path " + newPath.toString() + " does not exist.");
}
return true;
}
@@ -942,7 +936,7 @@ public class FTPClient {
public boolean LDIR() {
if (this.cmd.length != 1) {
- log.error("Syntax: LDIR (no parameter)");
+ log.warn("Syntax: LDIR (no parameter)");
return true;
}
final String[] name = this.currentLocalPath.list();
@@ -1207,7 +1201,7 @@ public class FTPClient {
public boolean LITERAL() {
if (this.cmd.length == 1) {
- log.error("Syntax: LITERAL <ftp-command> [<command-argument>] (see RFC959)");
+ log.warn("Syntax: LITERAL <ftp-command> [<command-argument>] (see RFC959)");
return true;
}
String s = "";
@@ -1217,7 +1211,7 @@ public class FTPClient {
try {
literal(s.substring(1));
} catch (final IOException e) {
- log.error("Error: Syntax of FTP-command wrong. See RFC959 for details.");
+ log.warn("Error: Syntax of FTP-command wrong. See RFC959 for details.");
}
return true;
}
@@ -1232,15 +1226,15 @@ public class FTPClient {
public boolean LMKDIR() {
if (this.cmd.length != 2) {
- log.error("Syntax: LMKDIR <folder-name>");
+ log.warn("Syntax: LMKDIR <folder-name>");
return true;
}
final File f = new File(this.currentLocalPath, this.cmd[1]);
if (f.exists()) {
- log.error("Error: local file/folder " + this.cmd[1] + " already exists");
+ log.warn("Error: local file/folder " + this.cmd[1] + " already exists");
} else {
if (!f.mkdir()) {
- log.error("Error: creation of local folder " + this.cmd[1] + " failed");
+ log.warn("Error: creation of local folder " + this.cmd[1] + " failed");
}
}
return true;
@@ -1248,7 +1242,7 @@ public class FTPClient {
public boolean LMV() {
if (this.cmd.length != 3) {
- log.error("Syntax: LMV <from> <to>");
+ log.warn("Syntax: LMV <from> <to>");
return true;
}
final File from = new File(this.cmd[1]);
@@ -1257,17 +1251,17 @@ public class FTPClient {
if (from.renameTo(to)) {
log.info("---- \"" + from.toString() + "\" renamed to \"" + to.toString() + "\"");
} else {
- log.error("rename failed");
+ log.warn("rename failed");
}
} else {
- log.error("\"" + to.toString() + "\" already exists");
+ log.warn("\"" + to.toString() + "\" already exists");
}
return true;
}
public boolean LPWD() {
if (this.cmd.length != 1) {
- log.error("Syntax: LPWD (no parameter)");
+ log.warn("Syntax: LPWD (no parameter)");
return true;
}
log.info("---- Local path: " + this.currentLocalPath.toString());
@@ -1280,15 +1274,15 @@ public class FTPClient {
public boolean LRMDIR() {
if (this.cmd.length != 2) {
- log.error("Syntax: LRMDIR <folder-name>");
+ log.warn("Syntax: LRMDIR <folder-name>");
return true;
}
final File f = new File(this.currentLocalPath, this.cmd[1]);
if (!f.exists()) {
- log.error("Error: local folder " + this.cmd[1] + " does not exist");
+ log.warn("Error: local folder " + this.cmd[1] + " does not exist");
} else {
if (!f.delete()) {
- log.error("Error: deletion of local folder " + this.cmd[1] + " failed");
+ log.warn("Error: deletion of local folder " + this.cmd[1] + " failed");
}
}
return true;
@@ -1296,15 +1290,15 @@ public class FTPClient {
public boolean LRM() {
if (this.cmd.length != 2) {
- log.error("Syntax: LRM <file-name>");
+ log.warn("Syntax: LRM <file-name>");
return true;
}
final File f = new File(this.currentLocalPath, this.cmd[1]);
if (!f.exists()) {
- log.error("Error: local file " + this.cmd[1] + " does not exist");
+ log.warn("Error: local file " + this.cmd[1] + " does not exist");
} else {
if (!f.delete()) {
- log.error("Error: deletion of file " + this.cmd[1] + " failed");
+ log.warn("Error: deletion of file " + this.cmd[1] + " failed");
}
}
return true;
@@ -1312,7 +1306,7 @@ public class FTPClient {
public boolean LS() {
if (this.cmd.length > 2) {
- log.error("Syntax: LS [<path>|<file>]");
+ log.warn("Syntax: LS [<path>|<file>]");
return true;
}
if (notConnected()) {
@@ -1327,7 +1321,7 @@ public class FTPClient {
}
printElements(l);
} catch (final IOException e) {
- log.error("Error: remote list not available (2): " + e.getMessage());
+ log.warn("Error: remote list not available (2): " + e.getMessage());
}
return true;
}
@@ -1409,7 +1403,7 @@ public class FTPClient {
public boolean MKDIR() {
if (this.cmd.length != 2) {
- log.error("Syntax: MKDIR <folder-name>");
+ log.warn("Syntax: MKDIR <folder-name>");
return true;
}
if (notConnected()) {
@@ -1424,20 +1418,20 @@ public class FTPClient {
throw new IOException(reply);
}
} catch (final IOException e) {
- log.error("Error: creation of folder " + this.cmd[1] + " failed");
+ log.warn("Error: creation of folder " + this.cmd[1] + " failed");
}
return true;
}
public boolean MGET() {
if (this.cmd.length != 2) {
- log.error("Syntax: MGET <file-pattern>");
+ log.warn("Syntax: MGET <file-pattern>");
return true;
}
try {
mget(this.cmd[1], false);
} catch (final IOException e) {
- log.error("Error: mget failed (" + e.getMessage() + ")");
+ log.warn("Error: mget failed (" + e.getMessage() + ")");
}
return true;
}
@@ -1449,9 +1443,9 @@ public class FTPClient {
if (matches(remote, pattern)) {
local = new File(this.currentLocalPath, remote);
if (local.exists()) {
- log.error("Warning: local file " + local.toString() + " overwritten.");
+ log.warn("Warning: local file " + local.toString() + " overwritten.");
if(!local.delete())
- log.error("Warning: local file " + local.toString() + " could not be deleted.");
+ log.warn("Warning: local file " + local.toString() + " could not be deleted.");
}
retrieveFilesRecursively(remote, remove);
}
@@ -1460,13 +1454,13 @@ public class FTPClient {
public boolean MOVEDOWN() {
if (this.cmd.length != 2) {
- log.error("Syntax: MOVEDOWN <file-pattern>");
+ log.warn("Syntax: MOVEDOWN <file-pattern>");
return true;
}
try {
mget(this.cmd[1], true);
} catch (final IOException e) {
- log.error("Error: movedown failed (" + e.getMessage() + ")");
+ log.warn("Error: movedown failed (" + e.getMessage() + ")");
}
return true;
}
@@ -1478,7 +1472,7 @@ public class FTPClient {
*/
public boolean MV() {
if (this.cmd.length != 3) {
- log.error("Syntax: MV <from> <to>");
+ log.warn("Syntax: MV <from> <to>");
return true;
}
if (notConnected()) {
@@ -1499,27 +1493,27 @@ public class FTPClient {
throw new IOException(reply);
}
} catch (final IOException e) {
- log.error("Error: rename of " + this.cmd[1] + " to " + this.cmd[2] + " failed.");
+ log.warn("Error: rename of " + this.cmd[1] + " to " + this.cmd[2] + " failed.");
}
return true;
}
public boolean NOOP() {
if (this.cmd.length != 1) {
- log.error("Syntax: NOOP (no parameter)");
+ log.warn("Syntax: NOOP (no parameter)");
return true;
}
try {
literal("NOOP");
} catch (final IOException e) {
- log.error("Error: server does not know how to do nothing");
+ log.warn("Error: server does not know how to do nothing");
}
return true;
}
public boolean OPEN() {
if ((this.cmd.length < 2) || (this.cmd.length > 3)) {
- log.error("Syntax: OPEN <host> [<port>]");
+ log.warn("Syntax: OPEN <host> [<port>]");
return true;
}
int port = 21;
@@ -1540,7 +1534,7 @@ public class FTPClient {
log.info("---- Connection to " + this.cmd[1] + " established.");
this.prompt = "ftp [" + this.cmd[1] + "]>";
} catch (final IOException e) {
- log.error("Error: connecting " + this.cmd[1] + " on port " + port + " failed: " + e.getMessage());
+ log.warn("Error: connecting " + this.cmd[1] + " on port " + port + " failed: " + e.getMessage());
}
return true;
}
@@ -1598,25 +1592,25 @@ public class FTPClient {
}
public boolean PROMPT() {
- log.error("prompt is always off");
+ log.warn("prompt is always off");
return true;
}
public boolean PUT() {
if ((this.cmd.length < 2) || (this.cmd.length > 3)) {
- log.error("Syntax: PUT <local-file> [<remote-file>]");
+ log.warn("Syntax: PUT <local-file> [<remote-file>]");
return true;
}
final File local = new File(this.currentLocalPath, this.cmd[1]);
final String remote = (this.cmd.length == 2) ? local.getName() : this.cmd[2];
if (!local.exists()) {
- log.error("Error: local file " + local.toString() + " does not exist.");
- log.error(" Remote file " + remote + " not overwritten.");
+ log.warn("Error: local file " + local.toString() + " does not exist.");
+ log.warn(" Remote file " + remote + " not overwritten.");
} else {
try {
put(local.getAbsolutePath(), remote);
} catch (final IOException e) {
- log.error("Error: transmitting file " + local.toString() + " failed.");
+ log.warn("Error: transmitting file " + local.toString() + " failed.");
}
}
return true;
@@ -1624,7 +1618,7 @@ public class FTPClient {
public boolean PWD() {
if (this.cmd.length > 1) {
- log.error("Syntax: PWD (no parameter)");
+ log.warn("Syntax: PWD (no parameter)");
return true;
}
if (notConnected()) {
@@ -1633,7 +1627,7 @@ public class FTPClient {
try {
log.info("---- Current remote path is: " + pwd());
} catch (final IOException e) {
- log.error("Error: remote path not available");
+ log.warn("Error: remote path not available");
}
return true;
}
@@ -1654,20 +1648,20 @@ public class FTPClient {
public boolean REMOTEHELP() {
if (this.cmd.length != 1) {
- log.error("Syntax: REMOTEHELP (no parameter)");
+ log.warn("Syntax: REMOTEHELP (no parameter)");
return true;
}
try {
literal("HELP");
} catch (final IOException e) {
- log.error("Error: remote help not supported by server.");
+ log.warn("Error: remote help not supported by server.");
}
return true;
}
public boolean RMDIR() {
if (this.cmd.length != 2) {
- log.error("Syntax: RMDIR <folder-name>");
+ log.warn("Syntax: RMDIR <folder-name>");
return true;
}
if (notConnected()) {
@@ -1676,7 +1670,7 @@ public class FTPClient {
try {
rmForced(this.cmd[1]);
} catch (final IOException e) {
- log.error("Error: deletion of folder " + this.cmd[1] + " failed.");
+ log.warn("Error: deletion of folder " + this.cmd[1] + " failed.");
}
return true;
}
@@ -1741,20 +1735,20 @@ public class FTPClient {
public boolean USER() {
if (this.cmd.length != 3) {
- log.error("Syntax: USER <user-name> <password>");
+ log.warn("Syntax: USER <user-name> <password>");
return true;
}
try {
login(this.cmd[1], this.cmd[2]);
log.info("---- Granted access for user " + this.cmd[1] + ".");
} catch (final IOException e) {
- log.error("Error: authorization of user " + this.cmd[1] + " failed: " + e.getMessage());
+ log.warn("Error: authorization of user " + this.cmd[1] + " failed: " + e.getMessage());
}
return true;
}
public boolean APPEND() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
@@ -1869,52 +1863,52 @@ public class FTPClient {
}
public boolean QUOTE() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean BELL() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean MDELETE() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean SEND() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean DEBUG() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean MLS() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean TRACE() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean MPUT() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean TYPE() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
public boolean CREATE() {
- log.error("not yet supported");
+ log.warn("not yet supported");
return true;
}
@@ -2272,7 +2266,7 @@ public class FTPClient {
+ (((stop - start) < 2000) ? (stop - start) + " milliseconds"
: (((int) ((stop - start) / 100)) / 10) + " seconds"));
if (start == stop) {
- log.error("start == stop");
+ log.warn("start == stop");
} else {
log.info(" (" + (length * 1000 / 1024 / (stop - start)) + " kbytes/second)");
}
@@ -2498,7 +2492,7 @@ public class FTPClient {
try {
applyDataSocketTimeout();
} catch (final SocketException e) {
- log.error("setDataSocketTimeout: " + e.getMessage());
+ log.warn("setDataSocketTimeout: " + e.getMessage());
}
}
@@ -2567,7 +2561,7 @@ public class FTPClient {
try {
list = ftpClient.list(path, true);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return;
}
if (!path.endsWith("/")) path += "/";
@@ -2777,7 +2771,7 @@ public class FTPClient {
Thread.currentThread().setName("FTP.pt(" + this.host + ")");
put(this.host, this.localFile, this.remotePath, this.remoteName, this.account, this.password);
} catch (final IOException e) {
- log.error(e, e);
+ log.warn(e.getMessage(), e);
}
}
}
@@ -2839,9 +2833,9 @@ public class FTPClient {
fos.write(UTF8.getBytes(page.toString()));
fos.close();
} catch (final FileNotFoundException e) {
- log.error(e);
+ log.warn(e);
} catch (final IOException e) {
- log.error(e);
+ log.warn(e);
}
} else if (args[0].equals("-sitelist")) {
try {
@@ -2851,11 +2845,11 @@ public class FTPClient {
System.out.println(entry.toString());
}
} catch (final FileNotFoundException e) {
- log.error(e);
+ log.warn(e);
} catch (final IOException e) {
- log.error(e);
+ log.warn(e);
} catch (final InterruptedException e) {
- log.error(e);
+ log.warn(e);
}
} else {
printHelp();
@@ -2880,7 +2874,7 @@ public class FTPClient {
put(args[1], new File(args[2]), args[3], "", args[4], args[5]);
} catch (final IOException e) {
// TODO Auto-generated catch block
- log.error(e, e);
+ log.warn(e.getMessage(), e);
}
} else {
printHelp();
diff --git a/source/net/yacy/kelondro/logging/Log.java b/source/net/yacy/cora/util/ConcurrentLog.java
similarity index 64%
rename from source/net/yacy/kelondro/logging/Log.java
rename to source/net/yacy/cora/util/ConcurrentLog.java
index d76f079de..69f947e55 100644
--- a/source/net/yacy/kelondro/logging/Log.java
+++ b/source/net/yacy/cora/util/ConcurrentLog.java
@@ -1,28 +1,24 @@
-// Log.java
-// -------------------------------------
-// (C) by Michael Peter Christen; [email protected]
-// first published on http://www.anomic.de
-// Frankfurt, Germany, 2004
-//
-// $LastChangedDate$
-// $LastChangedRevision$
-// $LastChangedBy$
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-package net.yacy.kelondro.logging;
+/**
+ * ConcurrentLog
+ * Copyright 2013 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
+ * First published 2004, redesigned 9.7.2013 on http://yacy.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.yacy.cora.util;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -41,31 +37,27 @@ import java.util.logging.LogManager;
import java.util.logging.Logger;
-public final class Log {
-
- // log-level categories
- public static final int LOGLEVEL_ZERO = Level.OFF.intValue(); // no output at all
- public static final int LOGLEVEL_SEVERE = Level.SEVERE.intValue(); // system-level error, internal cause, critical and not fixeable (i.e. inconsistency)
- public static final int LOGLEVEL_WARNING = Level.WARNING.intValue(); // uncritical service failure, may require user activity (i.e. input required, wrong authorization)
- public static final int LOGLEVEL_CONFIG = Level.CONFIG.intValue(); // regular system status information (i.e. start-up messages)
- public static final int LOGLEVEL_INFO = Level.INFO.intValue(); // regular action information (i.e. any httpd request URL)
- public static final int LOGLEVEL_FINE = Level.FINE.intValue(); // in-function status debug output
- public static final int LOGLEVEL_FINER = Level.FINER.intValue(); // in-function status debug output
- public static final int LOGLEVEL_FINEST = Level.FINEST.intValue(); // in-function status debug output
-
- // these categories are also present as character tokens
- public static final char LOGTOKEN_ZERO = 'Z';
- public static final char LOGTOKEN_SEVERE = 'E';
- public static final char LOGTOKEN_WARNING = 'W';
- public static final char LOGTOKEN_CONFIG = 'S';
- public static final char LOGTOKEN_INFO = 'I';
- public static final char LOGTOKEN_FINE = 'D';
- public static final char LOGTOKEN_FINER = 'D';
- public static final char LOGTOKEN_FINEST = 'D';
+/**
+ * jdk-based logger tend to block at java.util.logging.Logger.log(Logger.java:476)
+ * in concurrent environments. This makes logging a main performance issue.
+ * To overcome this problem, this is a add-on to jdk logging to put log entries
+ * on a concurrent message queue and log the messages one by one using a
+ * separate process
+ */
+public final class ConcurrentLog {
+
+
+ private final static Message POISON_MESSAGE = new Message();
+ private final static BlockingQueue<Message> logQueue = new ArrayBlockingQueue<Message>(300);
+ private final static Worker logRunnerThread = new Worker();
+
+ static {
+ logRunnerThread.start();
+ }
private final Logger theLogger;
- public Log(final String appName) {
+ public ConcurrentLog(final String appName) {
this.theLogger = Logger.getLogger(appName);
//this.theLogger.setLevel(Level.FINEST); // set a default level
}
@@ -74,11 +66,11 @@ public final class Log {
this.theLogger.setLevel(newLevel);
}
- public final void logSevere(final String message) {
+ public final void severe(final String message) {
enQueueLog(this.theLogger, Level.SEVERE, message);
}
- public final void logSevere(final String message, final Throwable thrown) {
+ public final void severe(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.SEVERE, message, thrown);
}
@@ -87,24 +79,29 @@ public final class Log {
return this.theLogger.isLoggable(Level.SEVERE);
}
- public final void logWarning(final String message) {
+ public final void warn(final String message) {
enQueueLog(this.theLogger, Level.WARNING, message);
}
- public final void logWarning(final String message, final Throwable thrown) {
+ public final void warn(final Throwable thrown) {
+ if (thrown == null) return;
+ enQueueLog(this.theLogger, Level.WARNING, thrown.getMessage(), thrown);
+ }
+
+ public final void warn(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.WARNING, message, thrown);
}
- public final boolean isWarning() {
+ public final boolean isWarn() {
return this.theLogger.isLoggable(Level.WARNING);
}
- public final void logConfig(final String message) {
+ public final void config(final String message) {
enQueueLog(this.theLogger, Level.CONFIG, message);
}
- public final void logConfig(final String message, final Throwable thrown) {
+ public final void config(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.CONFIG, message, thrown);
}
@@ -113,11 +110,11 @@ public final class Log {
return this.theLogger.isLoggable(Level.CONFIG);
}
- public final void logInfo(final String message) {
+ public final void info(final String message) {
enQueueLog(this.theLogger, Level.INFO, message);
}
- public final void logInfo(final String message, final Throwable thrown) {
+ public final void info(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.INFO, message, thrown);
}
@@ -126,11 +123,11 @@ public final class Log {
return this.theLogger.isLoggable(Level.INFO);
}
- public final void logFine(final String message) {
+ public final void fine(final String message) {
enQueueLog(this.theLogger, Level.FINE, message);
}
- public final void logFine(final String message, final Throwable thrown) {
+ public final void fine(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.FINE, message, thrown);
}
@@ -139,11 +136,11 @@ public final class Log {
return this.theLogger.isLoggable(Level.FINE);
}
- public final void logFiner(final String message) {
+ public final void finer(final String message) {
enQueueLog(this.theLogger, Level.FINER, message);
}
- public final void logFiner(final String message, final Throwable thrown) {
+ public final void finer(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.FINER, message, thrown);
}
@@ -152,11 +149,11 @@ public final class Log {
return this.theLogger.isLoggable(Level.FINER);
}
- public final void logFinest(final String message) {
+ public final void finest(final String message) {
enQueueLog(this.theLogger, Level.FINEST, message);
}
- public final void logFinest(final String message, final Throwable thrown) {
+ public final void finest(final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(this.theLogger, Level.FINEST, message, thrown);
}
@@ -171,46 +168,46 @@ public final class Log {
// static log messages
- public final static void logSevere(final String appName, final String message) {
+ public final static void logException(final Throwable thrown) {
+ if (thrown == null) return;
+ enQueueLog("StackTrace", Level.WARNING, thrown.getMessage(), thrown);
+ }
+ public final static void severe(final String appName, final String message) {
enQueueLog(appName, Level.SEVERE, message);
}
- public final static void logSevere(final String appName, final String message, final Throwable thrown) {
+ public final static void severe(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.SEVERE, message, thrown);
}
- public final static void logWarning(final String appName, final String message) {
+ public final static void warn(final String appName, final String message) {
enQueueLog(appName, Level.WARNING, message);
}
- public final static void logException(final Throwable thrown) {
- if (thrown == null) return;
- enQueueLog("StackTrace", Level.WARNING, thrown.getMessage(), thrown);
- }
- public final static void logWarning(final String appName, final String message, final Throwable thrown) {
+ public final static void warn(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.WARNING, message, thrown);
}
- public final static void logConfig(final String appName, final String message) {
+ public final static void config(final String appName, final String message) {
enQueueLog(appName, Level.CONFIG, message);
}
- public final static void logConfig(final String appName, final String message, final Throwable thrown) {
+ public final static void config(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.CONFIG, message, thrown);
}
- public final static void logInfo(final String appName, final String message) {
+ public final static void info(final String appName, final String message) {
enQueueLog(appName, Level.INFO, message);
}
- public final static void logInfo(final String appName, final String message, final Throwable thrown) {
+ public final static void info(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.INFO, message, thrown);
}
- public final static void logFine(final String appName, final String message) {
+ public final static void fine(final String appName, final String message) {
enQueueLog(appName, Level.FINE, message);
}
- public final static void logFine(final String appName, final String message, final Throwable thrown) {
+ public final static void fine(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.FINE, message, thrown);
}
@@ -218,18 +215,18 @@ public final class Log {
return Logger.getLogger(appName).isLoggable(Level.FINE);
}
- public final static void logFiner(final String appName, final String message) {
+ public final static void finer(final String appName, final String message) {
enQueueLog(appName, Level.FINER, message);
}
- public final static void logFiner(final String appName, final String message, final Throwable thrown) {
+ public final static void finer(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.FINER, message, thrown);
}
- public final static void logFinest(final String appName, final String message) {
+ public final static void finest(final String appName, final String message) {
enQueueLog(appName, Level.FINEST, message);
}
- public final static void logFinest(final String appName, final String message, final Throwable thrown) {
+ public final static void finest(final String appName, final String message, final Throwable thrown) {
if (thrown == null) return;
enQueueLog(appName, Level.FINEST, message, thrown);
}
@@ -243,7 +240,7 @@ public final class Log {
if (thrown == null) logger.log(level, message); else logger.log(level, message, thrown);
} else {
try {
- if (thrown == null) logQueue.put(new logEntry(logger, level, message)); else logQueue.put(new logEntry(logger, level, message, thrown));
+ if (thrown == null) logQueue.put(new Message(logger, level, message)); else logQueue.put(new Message(logger, level, message, thrown));
} catch (final InterruptedException e) {
if (thrown == null) logger.log(level, message); else logger.log(level, message, thrown);
}
@@ -256,7 +253,7 @@ public final class Log {
logger.log(level, message);
} else {
try {
- logQueue.put(new logEntry(logger, level, message));
+ logQueue.put(new Message(logger, level, message));
} catch (final InterruptedException e) {
logger.log(level, message);
}
@@ -268,7 +265,7 @@ public final class Log {
if (thrown == null) Logger.getLogger(loggername).log(level, message); else Logger.getLogger(loggername).log(level, message, thrown);
} else {
try {
- if (thrown == null) logQueue.put(new logEntry(loggername, level, message)); else logQueue.put(new logEntry(loggername, level, message, thrown));
+ if (thrown == null) logQueue.put(new Message(loggername, level, message)); else logQueue.put(new Message(loggername, level, message, thrown));
} catch (final InterruptedException e) {
if (thrown == null) Logger.getLogger(loggername).log(level, message); else Logger.getLogger(loggername).log(level, message, thrown);
}
@@ -280,48 +277,48 @@ public final class Log {
Logger.getLogger(loggername).log(level, message);
} else {
try {
- logQueue.put(new logEntry(loggername, level, message));
+ logQueue.put(new Message(loggername, level, message));
} catch (final InterruptedException e) {
Logger.getLogger(loggername).log(level, message);
}
}
}
- protected final static class logEntry {
+ protected final static class Message {
private final Level level;
private final String message;
private Logger logger;
private String loggername;
private Throwable thrown;
- private logEntry(final Level level, final String message) {
+ private Message(final Level level, final String message) {
this.level = level;
this.message = message == null || message.length() <= 1024 ? message : message.substring(0, 1024);
}
- public logEntry(final Logger logger, final Level level, final String message, final Throwable thrown) {
+ public Message(final Logger logger, final Level level, final String message, final Throwable thrown) {
this(level, message);
this.logger = logger;
this.loggername = null;
this.thrown = thrown;
}
- public logEntry(final Logger logger, final Level level, final String message) {
+ public Message(final Logger logger, final Level level, final String message) {
this(level, message);
this.logger = logger;
this.loggername = null;
this.thrown = null;
}
- public logEntry(final String loggername, final Level level, final String message, final Throwable thrown) {
+ public Message(final String loggername, final Level level, final String message, final Throwable thrown) {
this(level, message);
this.logger = null;
this.loggername = loggername;
this.thrown = thrown;
}
- public logEntry(final String loggername, final Level level, final String message) {
+ public Message(final String loggername, final Level level, final String message) {
this(level, message);
this.logger = null;
this.loggername = loggername;
this.thrown = null;
}
- public logEntry() {
+ public Message() {
this.logger = null;
this.loggername = null;
this.level = null;
@@ -330,26 +327,18 @@ public final class Log {
}
}
- private final static logEntry poison = new logEntry();
- private final static BlockingQueue<logEntry> logQueue = new ArrayBlockingQueue<logEntry>(300);
- private final static logRunner logRunnerThread = new logRunner();
-
- static {
- logRunnerThread.start();
- }
-
- protected final static class logRunner extends Thread {
- public logRunner() {
- super("Log Runner");
+ protected final static class Worker extends Thread {
+ public Worker() {
+ super("Log Worker");
}
@Override
public void run() {
- logEntry entry;
+ Message entry;
Map<String, Logger> loggerCache = new HashMap<String, Logger>();
//Map<String, AtomicInteger> loggerCounter = new HashMap<String, AtomicInteger>();
try {
- while ((entry = logQueue.take()) != poison) {
+ while ((entry = logQueue.take()) != POISON_MESSAGE) {
if (entry.logger == null) {
assert entry.loggername != null;
//AtomicInteger i = loggerCounter.get(entry.loggername);
@@ -372,7 +361,7 @@ public final class Log {
}
}
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
//Logger.getLogger("Log").log(Level.INFO, "closing logRunner with cached loggers: " + loggerCounter.entrySet().toString());
}
@@ -408,7 +397,7 @@ public final class Log {
}
// redirect uncaught exceptions to logging
- final Log exceptionLog = new Log("UNCAUGHT-EXCEPTION");
+ final ConcurrentLog exceptionLog = new ConcurrentLog("UNCAUGHT-EXCEPTION");
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
@Override
public void uncaughtException(final Thread t, final Throwable e) {
@@ -418,10 +407,10 @@ public final class Log {
final PrintStream ps = new PrintStream(baos);
e.printStackTrace(ps);
ps.close();
- exceptionLog.logSevere(msg + "\n" + baos.toString(), e);
- Log.logException(e);
- Log.logException(e.getCause());
- if (e instanceof InvocationTargetException) Log.logException(((InvocationTargetException) e).getTargetException());
+ exceptionLog.severe(msg + "\n" + baos.toString(), e);
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e.getCause());
+ if (e instanceof InvocationTargetException) ConcurrentLog.logException(((InvocationTargetException) e).getTargetException());
}
});
} finally {
@@ -432,7 +421,7 @@ public final class Log {
public final static void shutdown() {
if (logRunnerThread == null || !logRunnerThread.isAlive()) return;
try {
- logQueue.put(poison);
+ logQueue.put(POISON_MESSAGE);
logRunnerThread.join(1000);
} catch (final InterruptedException e) {
}
diff --git a/source/net/yacy/crawler/Balancer.java b/source/net/yacy/crawler/Balancer.java
index 37ae15f20..f09abbbe5 100644
--- a/source/net/yacy/crawler/Balancer.java
+++ b/source/net/yacy/crawler/Balancer.java
@@ -46,6 +46,7 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.sorting.OrderedScoreMap;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.CrawlProfile;
@@ -57,7 +58,6 @@ import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.BufferedObjectIndex;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.repository.Blacklist.BlacklistType;
@@ -122,11 +122,11 @@ public class Balancer {
try {
this.urlFileIndex = new BufferedObjectIndex(new Table(f, Request.rowdef, 0, 0, false, exceed134217727, true), objectIndexBufferSize);
} catch (final SpaceExceededException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
this.lastDomainStackFill = 0;
- Log.logInfo("Balancer", "opened balancer file with " + this.urlFileIndex.size() + " entries from " + f.toString());
+ ConcurrentLog.info("Balancer", "opened balancer file with " + this.urlFileIndex.size() + " entries from " + f.toString());
}
public int getMinimumLocalDelta() {
@@ -150,11 +150,11 @@ public class Balancer {
}
public void clear() {
- Log.logInfo("Balancer", "cleaning balancer with " + this.urlFileIndex.size() + " entries from " + this.urlFileIndex.filename());
+ ConcurrentLog.info("Balancer", "cleaning balancer with " + this.urlFileIndex.size() + " entries from " + this.urlFileIndex.filename());
try {
this.urlFileIndex.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.domainStacks.clear();
this.double_push_check.clear();
@@ -435,7 +435,7 @@ public class Balancer {
// check blacklist (again) because the user may have created blacklist entries after the queue has been filled
if (Switchboard.urlBlacklist.isListed(BlacklistType.CRAWLER, crawlEntry.url())) {
- Log.logFine("CRAWLER", "URL '" + crawlEntry.url() + "' is in blacklist.");
+ ConcurrentLog.fine("CRAWLER", "URL '" + crawlEntry.url() + "' is in blacklist.");
continue;
}
@@ -443,7 +443,7 @@ public class Balancer {
// if not: return null. A calling method must handle the null value and try again
profileEntry = cs.getActive(UTF8.getBytes(crawlEntry.profileHandle()));
if (profileEntry == null) {
- Log.logWarning("Balancer", "no profile entry for handle " + crawlEntry.profileHandle());
+ ConcurrentLog.warn("Balancer", "no profile entry for handle " + crawlEntry.profileHandle());
continue;
}
// depending on the caching policy we need sleep time to avoid DoS-like situations
@@ -465,7 +465,7 @@ public class Balancer {
// in best case, this should never happen if the balancer works propertly
// this is only to protection against the worst case, where the crawler could
// behave in a DoS-manner
- Log.logInfo("BALANCER", "forcing crawl-delay of " + sleeptime + " milliseconds for " + crawlEntry.url().getHost() + ": " + Latency.waitingRemainingExplain(crawlEntry.url(), robots, this.myAgentIDs, this.minimumLocalDelta, this.minimumGlobalDelta) + ", domainStacks.size() = " + this.domainStacks.size() + ", domainStacksInitSize = " + this.domStackInitSize);
+ ConcurrentLog.info("BALANCER", "forcing crawl-delay of " + sleeptime + " milliseconds for " + crawlEntry.url().getHost() + ": " + Latency.waitingRemainingExplain(crawlEntry.url(), robots, this.myAgentIDs, this.minimumLocalDelta, this.minimumGlobalDelta) + ", domainStacks.size() = " + this.domainStacks.size() + ", domainStacksInitSize = " + this.domStackInitSize);
long loops = sleeptime / 1000;
long rest = sleeptime % 1000;
if (loops < 3) {
@@ -477,7 +477,7 @@ public class Balancer {
// must be synchronized here to avoid 'takeover' moves from other threads which then idle the same time which would not be enough
if (rest > 0) {try {this.wait(rest);} catch (final InterruptedException e) {}}
for (int i = 0; i < loops; i++) {
- Log.logInfo("BALANCER", "waiting for " + crawlEntry.url().getHost() + ": " + (loops - i) + " seconds remaining...");
+ ConcurrentLog.info("BALANCER", "waiting for " + crawlEntry.url().getHost() + ": " + (loops - i) + " seconds remaining...");
try {this.wait(1000); } catch (final InterruptedException e) {}
}
}
@@ -499,7 +499,7 @@ public class Balancer {
try {
fillDomainStacks();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// iterate over the domain stacks
@@ -596,7 +596,7 @@ public class Balancer {
host = z.getKey(); if (host == null) continue;
hash = z.getValue(); if (hash == null) continue;
removeHashFromDomainStacks(host, hash);
- Log.logInfo("Balancer", "// getbest: picked a random from the zero-waiting stack: " + host + ", zeroWaitingCandidates.size = " + this.zeroWaitingCandidates.size());
+ ConcurrentLog.info("Balancer", "// getbest: picked a random from the zero-waiting stack: " + host + ", zeroWaitingCandidates.size = " + this.zeroWaitingCandidates.size());
return hash;
}
@@ -620,7 +620,7 @@ public class Balancer {
// check blacklist (again) because the user may have created blacklist entries after the queue has been filled
if (Switchboard.urlBlacklist.isListed(BlacklistType.CRAWLER, request.url())) {
- Log.logFine("CRAWLER", "URL '" + request.url() + "' is in blacklist.");
+ ConcurrentLog.fine("CRAWLER", "URL '" + request.url() + "' is in blacklist.");
try {blackhandles.put(entry.getPrimaryKeyBytes());} catch (SpaceExceededException e) {}
continue;
}
@@ -638,7 +638,7 @@ public class Balancer {
// if we collected blacklist entries then delete them now
for (byte[] blackhandle: blackhandles) this.urlFileIndex.remove(blackhandle);
- Log.logInfo("BALANCER", "re-fill of domain stacks; fileIndex.size() = " + this.urlFileIndex.size() + ", domainStacks.size = " + this.domainStacks.size() + ", blackhandles = " + blackhandles.size() + ", collection time = " + (System.currentTimeMillis() - this.lastDomainStackFill) + " ms");
+ ConcurrentLog.info("BALANCER", "re-fill of domain stacks; fileIndex.size() = " + this.urlFileIndex.size() + ", domainStacks.size = " + this.domainStacks.size() + ", blackhandles = " + blackhandles.size() + ", collection time = " + (System.currentTimeMillis() - this.lastDomainStackFill) + " ms");
this.domStackInitSize = this.domainStacks.size();
}
@@ -665,7 +665,7 @@ public class Balancer {
try {
return (entry == null) ? null : new Request(entry);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.rowIterator = null;
return null;
}
diff --git a/source/net/yacy/crawler/CrawlStacker.java b/source/net/yacy/crawler/CrawlStacker.java
index 5550c3f38..ee8fbf685 100644
--- a/source/net/yacy/crawler/CrawlStacker.java
+++ b/source/net/yacy/crawler/CrawlStacker.java
@@ -42,6 +42,7 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.ftp.FTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.crawler.data.NoticedURL;
@@ -56,7 +57,6 @@ import net.yacy.crawler.retrieval.SMBLoader;
import net.yacy.crawler.robots.RobotsTxt;
import net.yacy.kelondro.data.citation.CitationReference;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.IndexCell;
import net.yacy.kelondro.workflow.WorkflowProcessor;
import net.yacy.peers.SeedDB;
@@ -71,7 +71,7 @@ public final class CrawlStacker {
public static String ERROR_MATCH_WITH_MUST_NOT_MATCH_FILTER = "url matches must-not-match filter ";
- private final Log log = new Log("STACKCRAWL");
+ private final ConcurrentLog log = new ConcurrentLog("STACKCRAWL");
private final RobotsTxt robots;
private final WorkflowProcessor<Request> requestQueue;
private final CrawlQueues nextQueue;
@@ -101,7 +101,7 @@ public final class CrawlStacker {
this.acceptGlobalURLs = acceptGlobalURLs;
this.domainList = domainList;
this.requestQueue = new WorkflowProcessor<Request>("CrawlStacker", "This process checks new urls before they are enqueued into the balancer (proper, double-check, correct domain, filter)", new String[]{"Balancer"}, this, "job", 10000, null, WorkflowProcessor.availableCPU);
- this.log.logInfo("STACKCRAWL thread initialized.");
+ this.log.info("STACKCRAWL thread initialized.");
}
@@ -118,15 +118,15 @@ public final class CrawlStacker {
}
public void announceClose() {
- this.log.logInfo("Flushing remaining " + size() + " crawl stacker job entries.");
+ this.log.info("Flushing remaining " + size() + " crawl stacker job entries.");
this.requestQueue.shutdown();
}
public synchronized void close() {
- this.log.logInfo("Shutdown. waiting for remaining " + size() + " crawl stacker job entries. please wait.");
+ this.log.info("Shutdown. waiting for remaining " + size() + " crawl stacker job entries. please wait.");
this.requestQueue.shutdown();
- this.log.logInfo("Shutdown. Closing stackCrawl queue.");
+ this.log.info("Shutdown. Closing stackCrawl queue.");
clear();
}
@@ -141,7 +141,7 @@ public final class CrawlStacker {
if (urlCitationIndex != null && entry.referrerhash() != null) try {
urlCitationIndex.add(anchorhash, new CitationReference(entry.referrerhash(), entry.appdate().getTime()));
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try {
@@ -152,7 +152,7 @@ public final class CrawlStacker {
this.nextQueue.errorURL.push(entry, ASCII.getBytes(this.peers.mySeed().hash), new Date(), 1, FailCategory.FINAL_LOAD_CONTEXT, rejectReason, -1);
}
} catch (final Exception e) {
- CrawlStacker.this.log.logWarning("Error while processing stackCrawl entry.\n" + "Entry: " + entry.toString() + "Error: " + e.toString(), e);
+ CrawlStacker.this.log.warn("Error while processing stackCrawl entry.\n" + "Entry: " + entry.toString() + "Error: " + e.toString(), e);
return null;
}
return null;
@@ -161,7 +161,7 @@ public final class CrawlStacker {
public void enqueueEntry(final Request entry) {
// DEBUG
- if (this.log.isFinest()) this.log.logFinest("ENQUEUE " + entry.url() + ", referer=" + entry.referrerhash() + ", initiator=" + ((entry.initiator() == null) ? "" : ASCII.String(entry.initiator())) + ", name=" + entry.name() + ", appdate=" + entry.appdate() + ", depth=" + entry.depth());
+ if (this.log.isFinest()) this.log.finest("ENQUEUE " + entry.url() + ", referer=" + entry.referrerhash() + ", initiator=" + ((entry.initiator() == null) ? "" : ASCII.String(entry.initiator())) + ", name=" + entry.name() + ", appdate=" + entry.appdate() + ", depth=" + entry.depth());
this.requestQueue.enQueue(entry);
}
public void enqueueEntriesAsynchronous(final byte[] initiator, final String profileHandle, final Map<DigestURI, Properties> hyperlinks) {
@@ -299,7 +299,7 @@ public final class CrawlStacker {
String error;
if (profile == null) {
error = "LOST STACKER PROFILE HANDLE '" + entry.profileHandle() + "' for URL " + entry.url();
- this.log.logWarning(error);
+ this.log.warn(error);
return error;
}
@@ -321,7 +321,7 @@ public final class CrawlStacker {
if (!local && !global && !remote && !proxy) {
error = "URL '" + entry.url().toString() + "' cannot be crawled. initiator = " + ((entry.initiator() == null) ? "" : ASCII.String(entry.initiator())) + ", profile.handle = " + profile.handle();
- this.log.logSevere(error);
+ this.log.severe(error);
return error;
}
@@ -353,20 +353,20 @@ public final class CrawlStacker {
if (global) {
// it may be possible that global == true and local == true, so do not check an error case against it
- if (proxy) this.log.logWarning("URL '" + entry.url().toString() + "' has conflicting initiator properties: global = true, proxy = true, initiator = proxy" + ", profile.handle = " + profile.handle());
- if (remote) this.log.logWarning("URL '" + entry.url().toString() + "' has conflicting initiator properties: global = true, remote = true, initiator = " + ASCII.String(entry.initiator()) + ", profile.handle = " + profile.handle());
+ if (proxy) this.log.warn("URL '" + entry.url().toString() + "' has conflicting initiator properties: global = true, proxy = true, initiator = proxy" + ", profile.handle = " + profile.handle());
+ if (remote) this.log.warn("URL '" + entry.url().toString() + "' has conflicting initiator properties: global = true, remote = true, initiator = " + ASCII.String(entry.initiator()) + ", profile.handle = " + profile.handle());
warning = this.nextQueue.noticeURL.push(NoticedURL.StackType.GLOBAL, entry, this.robots);
} else if (local) {
- if (proxy) this.log.logWarning("URL '" + entry.url().toString() + "' has conflicting initiator properties: local = true, proxy = true, initiator = proxy" + ", profile.handle = " + profile.handle());
- if (remote) this.log.logWarning("URL '" + entry.url().toString() + "' has conflicting initiator properties: local = true, remote = true, initiator = " + ASCII.String(entry.initiator()) + ", profile.handle = " + profile.handle());
+ if (proxy) this.log.warn("URL '" + entry.url().toString() + "' has conflicting initiator properties: local = true, proxy = true, initiator = proxy" + ", profile.handle = " + profile.handle());
+ if (remote) this.log.warn("URL '" + entry.url().toString() + "' has conflicting initiator properties: local = true, remote = true, initiator = " + ASCII.String(entry.initiator()) + ", profile.handle = " + profile.handle());
warning = this.nextQueue.noticeURL.push(NoticedURL.StackType.LOCAL, entry, this.robots);
} else if (proxy) {
- if (remote) this.log.logWarning("URL '" + entry.url().toString() + "' has conflicting initiator properties: proxy = true, remote = true, initiator = " + ASCII.String(entry.initiator()) + ", profile.handle = " + profile.handle());
+ if (remote) this.log.warn("URL '" + entry.url().toString() + "' has conflicting initiator properties: proxy = true, remote = true, initiator = " + ASCII.String(entry.initiator()) + ", profile.handle = " + profile.handle());
warning = this.nextQueue.noticeURL.push(NoticedURL.StackType.LOCAL, entry, this.robots);
} else if (remote) {
warning = this.nextQueue.noticeURL.push(NoticedURL.StackType.REMOTE, entry, this.robots);
}
- if (warning != null && this.log.isFine()) this.log.logFine("CrawlStacker.stackCrawl of URL " + entry.url().toNormalform(true) + " - not pushed: " + warning);
+ if (warning != null && this.log.isFine()) this.log.fine("CrawlStacker.stackCrawl of URL " + entry.url().toNormalform(true) + " - not pushed: " + warning);
return null;
}
@@ -377,44 +377,44 @@ public final class CrawlStacker {
final String urlProtocol = url.getProtocol();
final String urlstring = url.toString();
if (!Switchboard.getSwitchboard().loader.isSupportedProtocol(urlProtocol)) {
- this.log.logSevere("Unsupported protocol in URL '" + urlstring + "'.");
+ this.log.severe("Unsupported protocol in URL '" + urlstring + "'.");
return "unsupported protocol";
}
// check if ip is local ip address
final String urlRejectReason = urlInAcceptedDomain(url);
if (urlRejectReason != null) {
- if (this.log.isFine()) this.log.logFine("denied_(" + urlRejectReason + ")");
+ if (this.log.isFine()) this.log.fine("denied_(" + urlRejectReason + ")");
return "denied_(" + urlRejectReason + ")";
}
// check blacklist
if (Switchboard.urlBlacklist.isListed(BlacklistType.CRAWLER, url)) {
- this.log.logFine("URL '" + urlstring + "' is in blacklist.");
+ this.log.fine("URL '" + urlstring + "' is in blacklist.");
return "url in blacklist";
}
// filter with must-match for URLs
if ((depth > 0) && !profile.urlMustMatchPattern().matcher(urlstring).matches()) {
- if (this.log.isFine()) this.log.logFine("URL '" + urlstring + "' does not match must-match crawling filter '" + profile.urlMustMatchPattern().toString() + "'.");
+ if (this.log.isFine()) this.log.fine("URL '" + urlstring + "' does not match must-match crawling filter '" + profile.urlMustMatchPattern().toString() + "'.");
return ERROR_NO_MATCH_MUST_MATCH_FILTER + profile.urlMustMatchPattern().toString();
}
// filter with must-not-match for URLs
if ((depth > 0) && profile.urlMustNotMatchPattern().matcher(urlstring).matches()) {
- if (this.log.isFine()) this.log.logFine("URL '" + urlstring + "' matches must-not-match crawling filter '" + profile.urlMustNotMatchPattern().toString() + "'.");
+ if (this.log.isFine()) this.log.fine("URL '" + urlstring + "' matches must-not-match crawling filter '" + profile.urlMustNotMatchPattern().toString() + "'.");
return ERROR_MATCH_WITH_MUST_NOT_MATCH_FILTER + profile.urlMustNotMatchPattern().toString();
}
// deny cgi
if (url.isIndividual() && !profile.crawlingQ()) { // TODO: make special property for crawlingIndividual
- if (this.log.isFine()) this.log.logFine("URL '" + urlstring + "' is CGI URL.");
+ if (this.log.isFine()) this.log.fine("URL '" + urlstring + "' is CGI URL.");
return "individual url (sessionid etc) not wanted";
}
// deny post properties
if (url.isPOST() && !profile.crawlingQ()) {
- if (this.log.isFine()) this.log.logFine("URL '" + urlstring + "' is post URL.");
+ if (this.log.isFine()) this.log.fine("URL '" + urlstring + "' is post URL.");
return "post url not allowed";
}
@@ -434,13 +434,13 @@ public final class CrawlStacker {
final boolean recrawl = profile.recrawlIfOlder() > oldDate.getTime();
if (recrawl) {
if (this.log.isInfo())
- this.log.logInfo("RE-CRAWL of URL '" + urlstring + "': this url was crawled " +
+ this.log.info("RE-CRAWL of URL '" + urlstring + "': this url was crawled " +
((System.currentTimeMillis() - oldDate.getTime()) / 60000 / 60 / 24) + " days ago.");
} else {
if (dbocc == null) {
return "double in: LURL-DB, oldDate = " + oldDate.toString();
}
- if (this.log.isInfo()) this.log.logInfo("URL '" + urlstring + "' is double registered in '" + dbocc.toString() + "'. " + "Stack processing time:");
+ if (this.log.isInfo()) this.log.info("URL '" + urlstring + "' is double registered in '" + dbocc.toString() + "'. " + "Stack processing time:");
if (dbocc == HarvestProcess.ERRORS) {
final ZURL.Entry errorEntry = this.nextQueue.errorURL.get(url.hash());
return "double in: errors (" + errorEntry.anycause() + "), oldDate = " + oldDate.toString();
@@ -454,12 +454,12 @@ public final class CrawlStacker {
if (maxAllowedPagesPerDomain < Integer.MAX_VALUE && maxAllowedPagesPerDomain > 0) {
final AtomicInteger dp = profile.getCount(url.getHost());
if (dp != null && dp.get() >= maxAllowedPagesPerDomain) {
- if (this.log.isFine()) this.log.logFine("URL '" + urlstring + "' appeared too often in crawl stack, a maximum of " + maxAllowedPagesPerDomain + " is allowed.");
+ if (this.log.isFine()) this.log.fine("URL '" + urlstring + "' appeared too often in crawl stack, a maximum of " + maxAllowedPagesPerDomain + " is allowed.");
return "crawl stack domain counter exceeded";
}
if (ResultURLs.domainCount(EventOrigin.LOCAL_CRAWLING, url.getHost()) >= maxAllowedPagesPerDomain) {
- if (this.log.isFine()) this.log.logFine("URL '" + urlstring + "' appeared too often in result stack, a maximum of " + maxAllowedPagesPerDomain + " is allowed.");
+ if (this.log.isFine()) this.log.fine("URL '" + urlstring + "' appeared too often in result stack, a maximum of " + maxAllowedPagesPerDomain + " is allowed.");
return "result stack domain counter exceeded";
}
}
@@ -469,13 +469,13 @@ public final class CrawlStacker {
// filter with must-match for IPs
if ((depth > 0) && profile.ipMustMatchPattern() != CrawlProfile.MATCH_ALL_PATTERN && url.getHost() != null && !profile.ipMustMatchPattern().matcher(url.getInetAddress().getHostAddress()).matches()) {
- if (this.log.isFine()) this.log.logFine("IP " + url.getInetAddress().getHostAddress() + " of URL '" + urlstring + "' does not match must-match crawling filter '" + profile.ipMustMatchPattern().toString() + "'.");
+ if (this.log.isFine()) this.log.fine("IP " + url.getInetAddress().getHostAddress() + " of URL '" + urlstring + "' does not match must-match crawling filter '" + profile.ipMustMatchPattern().toString() + "'.");
return "ip " + url.getInetAddress().getHostAddress() + " of url does not match must-match filter";
}
// filter with must-not-match for IPs
if ((depth > 0) && profile.ipMustNotMatchPattern() != CrawlProfile.MATCH_NEVER_PATTERN && url.getHost() != null && profile.ipMustNotMatchPattern().matcher(url.getInetAddress().getHostAddress()).matches()) {
- if (this.log.isFine()) this.log.logFine("IP " + url.getInetAddress().getHostAddress() + " of URL '" + urlstring + "' matches must-not-match crawling filter '" + profile.ipMustNotMatchPattern().toString() + "'.");
+ if (this.log.isFine()) this.log.fine("IP " + url.getInetAddress().getHostAddress() + " of URL '" + urlstring + "' matches must-not-match crawling filter '" + profile.ipMustNotMatchPattern().toString() + "'.");
return "ip " + url.getInetAddress().getHostAddress() + " of url matches must-not-match filter";
}
@@ -493,7 +493,7 @@ public final class CrawlStacker {
}
}
if (!granted) {
- if (this.log.isFine()) this.log.logFine("IP " + url.getInetAddress().getHostAddress() + " of URL '" + urlstring + "' does not match must-match crawling filter '" + profile.ipMustMatchPattern().toString() + "'.");
+ if (this.log.isFine()) this.log.fine("IP " + url.getInetAddress().getHostAddress() + " of URL '" + urlstring + "' does not match must-match crawling filter '" + profile.ipMustMatchPattern().toString() + "'.");
return "country " + c0 + " of url does not match must-match filter for countries";
}
}
diff --git a/source/net/yacy/crawler/CrawlSwitchboard.java b/source/net/yacy/crawler/CrawlSwitchboard.java
index c21e87a49..cd41f8cbc 100644
--- a/source/net/yacy/crawler/CrawlSwitchboard.java
+++ b/source/net/yacy/crawler/CrawlSwitchboard.java
@@ -41,6 +41,7 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.CrawlQueues;
@@ -50,7 +51,6 @@ import net.yacy.kelondro.blob.MapHeap;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.kelondroException;
import net.yacy.search.Switchboard;
@@ -90,7 +90,7 @@ public final class CrawlSwitchboard {
public static final long CRAWL_PROFILE_SNIPPET_GLOBAL_MEDIA_RECRAWL_CYCLE = 60L * 24L * 30L;
public static final long CRAWL_PROFILE_SURROGATE_RECRAWL_CYCLE = 60L * 24L * 30L;
- private final Log log;
+ private final ConcurrentLog log;
private MapHeap profilesActiveCrawls;
private final MapHeap profilesPassiveCrawls;
private final Map<byte[], CrawlProfile> profilesActiveCrawlsCache; //TreeMap<byte[], DigestURI>(Base64Order.enhancedCoder);
@@ -103,12 +103,12 @@ public final class CrawlSwitchboard {
public CrawlProfile defaultSurrogateProfile;
private final File queuesRoot;
- public CrawlSwitchboard(final String networkName, final Log log, final File queuesRoot) {
+ public CrawlSwitchboard(final String networkName, final ConcurrentLog log, final File queuesRoot) {
- log.logInfo("Initializing Word Index for the network '" + networkName + "'.");
+ log.info("Initializing Word Index for the network '" + networkName + "'.");
if ( networkName == null || networkName.isEmpty() ) {
- log.logSevere("no network name given - shutting down");
+ log.severe("no network name given - shutting down");
System.exit(0);
}
this.log = log;
@@ -118,7 +118,7 @@ public final class CrawlSwitchboard {
// make crawl profiles database and default profiles
this.queuesRoot = queuesRoot;
this.queuesRoot.mkdirs();
- this.log.logConfig("Initializing Crawl Profiles");
+ this.log.config("Initializing Crawl Profiles");
final File profilesActiveFile = new File(queuesRoot, DBFILE_ACTIVE_CRAWL_PROFILES);
this.profilesActiveCrawls = loadFromDB(profilesActiveFile);
@@ -136,7 +136,7 @@ public final class CrawlSwitchboard {
}
}
initActiveCrawlProfiles();
- log.logInfo("Loaded active crawl profiles from file "
+ log.info("Loaded active crawl profiles from file "
+ profilesActiveFile.getName()
+ ", "
+ this.profilesActiveCrawls.size()
@@ -148,14 +148,14 @@ public final class CrawlSwitchboard {
CrawlProfile p;
try {
p = new CrawlProfile(this.profilesPassiveCrawls.get(handle));
- Log.logInfo("CrawlProfiles", "loaded Profile " + p.handle() + ": " + p.collectionName());
+ ConcurrentLog.info("CrawlProfiles", "loaded Profile " + p.handle() + ": " + p.collectionName());
} catch ( final IOException e ) {
continue;
} catch ( final SpaceExceededException e ) {
continue;
}
}
- log.logInfo("Loaded passive crawl profiles from file "
+ log.info("Loaded passive crawl profiles from file "
+ profilesPassiveFile.getName()
+ ", "
+ this.profilesPassiveCrawls.size()
@@ -486,7 +486,7 @@ public final class CrawlSwitchboard {
this.profilesActiveCrawls =
new MapHeap(pdb, Word.commonHashLength, NaturalOrder.naturalOrder, 1024 * 64, 500, ' ');
} catch ( final IOException e1 ) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
this.profilesActiveCrawls = null;
}
initActiveCrawlProfiles();
@@ -593,14 +593,14 @@ public final class CrawlSwitchboard {
try {
ret = new MapHeap(file, Word.commonHashLength, NaturalOrder.naturalOrder, 1024 * 64, 500, ' ');
} catch ( final IOException e ) {
- Log.logException(e);
- Log.logException(e);
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e);
FileUtils.deletedelete(file);
try {
ret =
new MapHeap(file, Word.commonHashLength, NaturalOrder.naturalOrder, 1024 * 64, 500, ' ');
} catch ( final IOException e1 ) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
ret = null;
}
}
diff --git a/source/net/yacy/crawler/data/Cache.java b/source/net/yacy/crawler/data/Cache.java
index 36e4526f8..ea067a3d2 100644
--- a/source/net/yacy/crawler/data/Cache.java
+++ b/source/net/yacy/crawler/data/Cache.java
@@ -45,6 +45,7 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.ArrayStack;
import net.yacy.kelondro.blob.Compressor;
@@ -52,7 +53,6 @@ import net.yacy.kelondro.blob.MapHeap;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
public final class Cache {
@@ -67,7 +67,7 @@ public final class Cache {
private static long maxCacheSize = Long.MAX_VALUE;
private static File cachePath = null;
private static String prefix;
- public static final Log log = new Log("HTCACHE");
+ public static final ConcurrentLog log = new ConcurrentLog("HTCACHE");
public static void init(final File htCachePath, final String peerSalt, final long CacheSizeMax) {
@@ -85,7 +85,7 @@ public final class Cache {
try {
responseHeaderDB = new MapHeap(dbfile, Word.commonHashLength, Base64Order.enhancedCoder, 1024 * 1024, 100, ' ');
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// open the cache file
try {
@@ -93,14 +93,14 @@ public final class Cache {
fileDBunbuffered.setMaxSize(maxCacheSize);
fileDB = new Compressor(fileDBunbuffered, 6 * 1024 * 1024);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- Log.logInfo("Cache", "initialized cache database responseHeaderDB.size() = " + responseHeaderDB.size() + ", fileDB.size() = " + fileDB.size());
+ ConcurrentLog.info("Cache", "initialized cache database responseHeaderDB.size() = " + responseHeaderDB.size() + ", fileDB.size() = " + fileDB.size());
// clean up the responseHeaderDB which cannot be cleaned the same way as the cache files.
// We do this as a concurrent job only once after start-up silently
if (responseHeaderDB.size() != fileDB.size()) {
- Log.logWarning("Cache", "file and metadata size is not equal, starting a cleanup thread...");
+ ConcurrentLog.warn("Cache", "file and metadata size is not equal, starting a cleanup thread...");
Thread startupCleanup = new Thread() {
@Override
public void run() {
@@ -108,7 +108,7 @@ public final class Cache {
// enumerate the responseHeaderDB and find out all entries that are not inside the fileDBunbuffered
BlockingQueue<byte[]> q = responseHeaderDB.keyQueue(1000);
final HandleSet delkeys = new RowHandleSet(Word.commonHashLength, Base64Order.enhancedCoder, 1);
- Log.logInfo("Cache", "started cleanup thread to remove unused cache metadata");
+ ConcurrentLog.info("Cache", "started cleanup thread to remove unused cache metadata");
try {
byte[] k;
while (((k = q.take()) != MapHeap.POISON_QUEUE_ENTRY)) {
@@ -117,7 +117,7 @@ public final class Cache {
} catch (InterruptedException e) {
} finally {
// delete the collected keys from the metadata
- Log.logInfo("Cache", "cleanup thread collected " + delkeys.size() + " unused metadata entries; now deleting them from the file...");
+ ConcurrentLog.info("Cache", "cleanup thread collected " + delkeys.size() + " unused metadata entries; now deleting them from the file...");
for (byte[] k: delkeys) {
try {
responseHeaderDB.delete(k);
@@ -126,19 +126,19 @@ public final class Cache {
}
}
- Log.logInfo("Cache", "running check to remove unused file cache data");
+ ConcurrentLog.info("Cache", "running check to remove unused file cache data");
delkeys.clear();
for (byte[] k: fileDB) {
if (!responseHeaderDB.containsKey(k)) try { delkeys.put(k); } catch (SpaceExceededException e) { break; }
}
- Log.logInfo("Cache", "cleanup thread collected " + delkeys.size() + " unused cache entries; now deleting them from the file...");
+ ConcurrentLog.info("Cache", "cleanup thread collected " + delkeys.size() + " unused cache entries; now deleting them from the file...");
for (byte[] k: delkeys) {
try {
fileDB.delete(k);
} catch (IOException e) {
}
}
- Log.logInfo("Cache", "terminated cleanup thread; responseHeaderDB.size() = " + responseHeaderDB.size() + ", fileDB.size() = " + fileDB.size());
+ ConcurrentLog.info("Cache", "terminated cleanup thread; responseHeaderDB.size() = " + responseHeaderDB.size() + ", fileDB.size() = " + fileDB.size());
}
};
startupCleanup.start();
@@ -157,12 +157,12 @@ public final class Cache {
try {
fileDB.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try {
fileDBunbuffered.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -195,7 +195,7 @@ public final class Cache {
if (maxCacheSize == 0) return;
if (responseHeader == null) throw new IOException("Cache.store of url " + url.toString() + " not possible: responseHeader == null");
if (file == null) throw new IOException("Cache.store of url " + url.toString() + " not possible: file == null");
- log.logInfo("storing content of url " + url.toString() + ", " + file.length + " bytes");
+ log.info("storing content of url " + url.toString() + ", " + file.length + " bytes");
// store the file
try {
@@ -216,7 +216,7 @@ public final class Cache {
fileDB.delete(url.hash());
throw new IOException("Cache.store: cannot write to headerDB: " + e.getMessage());
}
- if (log.isFine()) log.logFine("stored in cache: " + url.toNormalform(true));
+ if (log.isFine()) log.fine("stored in cache: " + url.toNormalform(true));
}
/**
@@ -235,7 +235,7 @@ public final class Cache {
if (!headerExists && !fileExists) return false;
// if not both is there then we do a clean-up
if (headerExists) try {
- log.logWarning("header but not content of urlhash " + ASCII.String(urlhash) + " in cache; cleaned up");
+ log.warn("header but not content of urlhash " + ASCII.String(urlhash) + " in cache; cleaned up");
responseHeaderDB.delete(urlhash);
} catch (final IOException e) {}
if (fileExists) try {
@@ -285,16 +285,16 @@ public final class Cache {
if (b == null) return null;
return b;
} catch (final UnsupportedEncodingException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch (final OutOfMemoryError e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -304,7 +304,7 @@ public final class Cache {
try {
return fileDB.containsKey(hash);
} catch (final OutOfMemoryError e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
}
diff --git a/source/net/yacy/crawler/data/CrawlProfile.java b/source/net/yacy/crawler/data/CrawlProfile.java
index d1470a734..51baa7451 100644
--- a/source/net/yacy/crawler/data/CrawlProfile.java
+++ b/source/net/yacy/crawler/data/CrawlProfile.java
@@ -39,9 +39,9 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.CrawlSwitchboard;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.server.serverObjects;
public class CrawlProfile extends ConcurrentHashMap<String, String> implements Map<String, String> {
@@ -430,7 +430,7 @@ public class CrawlProfile extends ConcurrentHashMap<String, String> implements M
try {
return Integer.parseInt(r);
} catch (final NumberFormatException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return 0;
}
}
@@ -447,7 +447,7 @@ public class CrawlProfile extends ConcurrentHashMap<String, String> implements M
try {
return CacheStrategy.decode(Integer.parseInt(r));
} catch (final NumberFormatException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return CacheStrategy.IFEXIST;
}
}
@@ -469,7 +469,7 @@ public class CrawlProfile extends ConcurrentHashMap<String, String> implements M
final long l = Long.parseLong(r);
return (l < 0) ? 0L : l;
} catch (final NumberFormatException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return 0L;
}
}
@@ -484,7 +484,7 @@ public class CrawlProfile extends ConcurrentHashMap<String, String> implements M
if (i < 0) return Integer.MAX_VALUE;
return i;
} catch (final NumberFormatException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return Integer.MAX_VALUE;
}
}
diff --git a/source/net/yacy/crawler/data/CrawlQueues.java b/source/net/yacy/crawler/data/CrawlQueues.java
index 8a8a771d9..9fcaba613 100644
--- a/source/net/yacy/crawler/data/CrawlQueues.java
+++ b/source/net/yacy/crawler/data/CrawlQueues.java
@@ -43,6 +43,7 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.ConnectionInfo;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.HarvestProcess;
import net.yacy.crawler.data.NoticedURL.StackType;
import net.yacy.crawler.data.ZURL.FailCategory;
@@ -50,7 +51,6 @@ import net.yacy.crawler.retrieval.Request;
import net.yacy.crawler.retrieval.Response;
import net.yacy.crawler.robots.RobotsTxtEntry;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.workflow.WorkflowJob;
import net.yacy.peers.DHTSelection;
@@ -68,7 +68,7 @@ public class CrawlQueues {
private static final String DELEGATED_DB_FILENAME = "urlDelegated4.db";
private Switchboard sb;
- private Log log;
+ private ConcurrentLog log;
private Map<Integer, Loader> workers; // mapping from url hash to Worker thread object
private final ArrayList<String> remoteCrawlProviderHashes;
@@ -77,12 +77,12 @@ public class CrawlQueues {
public CrawlQueues(final Switchboard sb, final File queuePath) {
this.sb = sb;
- this.log = new Log("CRAWLER");
+ this.log = new ConcurrentLog("CRAWLER");
this.workers = new ConcurrentHashMap<Integer, Loader>();
this.remoteCrawlProviderHashes = new ArrayList<String>();
// start crawling management
- this.log.logConfig("Starting Crawling Management");
+ this.log.config("Starting Crawling Management");
this.noticeURL = new NoticedURL(queuePath, sb.peers.myBotIDs(), sb.useTailCache, sb.exceed134217727);
FileUtils.deletedelete(new File(queuePath, ERROR_DB_FILENAME));
this.errorURL = new ZURL(sb.index.fulltext(), queuePath, ERROR_DB_FILENAME, false, sb.useTailCache, sb.exceed134217727);
@@ -110,7 +110,7 @@ public class CrawlQueues {
try {
w.join();
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
this.noticeURL.close();
@@ -128,12 +128,12 @@ public class CrawlQueues {
try {
this.errorURL.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try {
this.delegatedURL.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -229,7 +229,7 @@ public class CrawlQueues {
for (int i = 0; i < toshift; i++) {
this.noticeURL.shift(NoticedURL.StackType.GLOBAL, NoticedURL.StackType.LOCAL, this.sb.crawler, this.sb.robots);
}
- this.log.logInfo("shifted " + toshift + " jobs from global crawl to local crawl (coreCrawlJobSize()=" + coreCrawlJobSize() +
+ this.log.info("shifted " + toshift + " jobs from global crawl to local crawl (coreCrawlJobSize()=" + coreCrawlJobSize() +
", limitCrawlJobSize()=" + limitCrawlJobSize() + ", cluster.mode=" + this.sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "") +
", robinsonMode=" + ((this.sb.isRobinsonMode()) ? "on" : "off"));
}
@@ -238,14 +238,14 @@ public class CrawlQueues {
final String queueCheckNoload = loadIsPossible(NoticedURL.StackType.NOLOAD);
if (queueCheckCore != null && queueCheckNoload != null) {
if (this.log.isFine()) {
- this.log.logFine("omitting de-queue/local: " + queueCheckCore + ":" + queueCheckNoload);
+ this.log.fine("omitting de-queue/local: " + queueCheckCore + ":" + queueCheckNoload);
}
return false;
}
if (isPaused(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL)) {
if (this.log.isFine()) {
- this.log.logFine("omitting de-queue/local: paused");
+ this.log.fine("omitting de-queue/local: paused");
}
return false;
}
@@ -267,16 +267,16 @@ public class CrawlQueues {
}
final String profileHandle = urlEntry.profileHandle();
if (profileHandle == null) {
- this.log.logSevere(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
+ this.log.severe(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
return true;
}
final CrawlProfile profile = this.sb.crawler.getActive(ASCII.getBytes(profileHandle));
if (profile == null) {
- this.log.logSevere(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
+ this.log.severe(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
return true;
}
this.sb.indexingDocumentProcessor.enQueue(new IndexingQueueEntry(new Response(urlEntry, profile), null, null));
- Log.logInfo("CrawlQueues", "placed NOLOAD URL on indexing queue: " + urlEntry.url().toNormalform(true));
+ ConcurrentLog.info("CrawlQueues", "placed NOLOAD URL on indexing queue: " + urlEntry.url().toNormalform(true));
return true;
}
@@ -288,13 +288,13 @@ public class CrawlQueues {
// System.out.println("DEBUG plasmaSwitchboard.processCrawling:
// profileHandle = " + profileHandle + ", urlEntry.url = " + urlEntry.url());
if (profileHandle == null) {
- this.log.logSevere(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
+ this.log.severe(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
return true;
}
load(urlEntry, stats, profileHandle);
return true;
} catch (final IOException e) {
- this.log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);
+ this.log.severe(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);
if (e.getMessage().indexOf("hash is null",0) > 0) {
this.noticeURL.clear(NoticedURL.StackType.LOCAL);
}
@@ -320,7 +320,7 @@ public class CrawlQueues {
final String urlProtocol = url.getProtocol();
if (this.sb.loader.isSupportedProtocol(urlProtocol)) {
if (this.log.isFine()) {
- this.log.logFine(stats + ": URL=" + urlEntry.url()
+ this.log.fine(stats + ": URL=" + urlEntry.url()
+ ", initiator=" + ((urlEntry.initiator() == null) ? "" : ASCII.String(urlEntry.initiator()))
+ ", crawlOrder=" + ((profile.remoteIndexing()) ? "true" : "false")
+ ", depth=" + urlEntry.depth()
@@ -332,7 +332,7 @@ public class CrawlQueues {
// work off one Crawl stack entry
if (urlEntry == null || urlEntry.url() == null) {
- this.log.logInfo(stats + ": urlEntry = null");
+ this.log.info(stats + ": urlEntry = null");
} else {
if (!this.workers.containsKey(Integer.valueOf(urlEntry.hashCode()))) {
Loader loader = new Loader(urlEntry);
@@ -340,17 +340,17 @@ public class CrawlQueues {
try {
loader.start();
} catch (final OutOfMemoryError e) {
- Log.logWarning("CrawlQueues", "crawlWorker sequential fail-over: " + e.getMessage());
+ ConcurrentLog.warn("CrawlQueues", "crawlWorker sequential fail-over: " + e.getMessage());
loader.run();
}
}
}
} else {
- this.log.logSevere("Unsupported protocol in URL '" + url.toString());
+ this.log.severe("Unsupported protocol in URL '" + url.toString());
}
} else {
- if (this.log.isFine()) this.log.logFine(stats + ": LOST PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
+ if (this.log.isFine()) this.log.fine(stats + ": LOST PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());
}
}
@@ -424,7 +424,7 @@ public class CrawlQueues {
// check again
if (this.workers.size() >= this.sb.getConfigLong(SwitchboardConstants.CRAWLER_THREADS_ACTIVE_MAX, 20)) {
if (this.log.isFine()) {
- this.log.logFine("remoteCrawlLoaderJob: too many processes in loader queue, dismissed (" + "cacheLoader=" + this.workers.size() + "), httpClients = " + ConnectionInfo.getCount());
+ this.log.fine("remoteCrawlLoaderJob: too many processes in loader queue, dismissed (" + "cacheLoader=" + this.workers.size() + "), httpClients = " + ConnectionInfo.getCount());
}
return false;
}
@@ -432,21 +432,21 @@ public class CrawlQueues {
final String cautionCause = this.sb.onlineCaution();
if (cautionCause != null) {
if (this.log.isFine()) {
- this.log.logFine("remoteCrawlLoaderJob: online caution for " + cautionCause + ", omitting processing");
+ this.log.fine("remoteCrawlLoaderJob: online caution for " + cautionCause + ", omitting processing");
}
return false;
}
if (remoteTriggeredCrawlJobSize() > 200) {
if (this.log.isFine()) {
- this.log.logFine("remoteCrawlLoaderJob: the remote-triggered crawl job queue is filled, omitting processing");
+ this.log.fine("remoteCrawlLoaderJob: the remote-triggered crawl job queue is filled, omitting processing");
}
return false;
}
if (coreCrawlJobSize() > 0 /*&& sb.indexingStorageProcessor.queueSize() > 0*/) {
if (this.log.isFine()) {
- this.log.logFine("remoteCrawlLoaderJob: a local crawl is running, omitting processing");
+ this.log.fine("remoteCrawlLoaderJob: a local crawl is running, omitting processing");
}
return false;
}
@@ -522,7 +522,7 @@ public class CrawlQueues {
if (urlRejectReason == null) {
// stack url
if (this.sb.getLog().isFinest()) {
- this.sb.getLog().logFinest("crawlOrder: stack: url='" + url + "'");
+ this.sb.getLog().finest("crawlOrder: stack: url='" + url + "'");
}
this.sb.crawlStacker.enqueueEntry(new Request(
ASCII.getBytes(hash),
@@ -537,7 +537,7 @@ public class CrawlQueues {
item.getSize()
));
} else {
- this.log.logWarning("crawlOrder: Rejected URL '" + urlToString(url) + "': " + urlRejectReason);
+ this.log.warn("crawlOrder: Rejected URL '" + urlToString(url) + "': " + urlRejectReason);
}
}
return true;
@@ -571,14 +571,14 @@ public class CrawlQueues {
final String queueCheck = loadIsPossible(NoticedURL.StackType.REMOTE);
if (queueCheck != null) {
if (this.log.isFinest()) {
- this.log.logFinest("omitting de-queue/remote: " + queueCheck);
+ this.log.finest("omitting de-queue/remote: " + queueCheck);
}
return false;
}
if (isPaused(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL)) {
if (this.log.isFinest()) {
- this.log.logFinest("omitting de-queue/remote: paused");
+ this.log.finest("omitting de-queue/remote: paused");
}
return false;
}
@@ -595,7 +595,7 @@ public class CrawlQueues {
load(urlEntry, stats, profileHandle);
return true;
} catch (final IOException e) {
- this.log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);
+ this.log.severe(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);
if (e.getMessage().indexOf("hash is null",0) > 0) {
this.noticeURL.clear(NoticedURL.StackType.REMOTE);
}
@@ -657,7 +657,7 @@ public class CrawlQueues {
if (response == null) {
this.request.setStatus("error", WorkflowJob.STATUS_FINISHED);
if (CrawlQueues.this.log.isFine()) {
- CrawlQueues.this.log.logFine("problem loading " + this.request.url().toString() + ": no content (possibly caused by cache policy)");
+ CrawlQueues.this.log.fine("problem loading " + this.request.url().toString() + ": no content (possibly caused by cache policy)");
}
result = "no content (possibly caused by cache policy)";
} else {
@@ -669,7 +669,7 @@ public class CrawlQueues {
} catch (final IOException e) {
this.request.setStatus("error", WorkflowJob.STATUS_FINISHED);
if (CrawlQueues.this.log.isFine()) {
- CrawlQueues.this.log.logFine("problem loading " + this.request.url().toString() + ": " + e.getMessage());
+ CrawlQueues.this.log.fine("problem loading " + this.request.url().toString() + ": " + e.getMessage());
}
result = "load error - " + e.getMessage();
}
@@ -695,7 +695,7 @@ public class CrawlQueues {
1,
FailCategory.TEMPORARY_NETWORK_FAILURE,
e.getMessage() + " - in worker", -1);
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.request.setStatus("worker-exception", WorkflowJob.STATUS_FINISHED);
} finally {
CrawlQueues.this.workers.remove(this.code);
diff --git a/source/net/yacy/crawler/data/NoticedURL.java b/source/net/yacy/crawler/data/NoticedURL.java
index 365c152f4..e23adcc1a 100644
--- a/source/net/yacy/crawler/data/NoticedURL.java
+++ b/source/net/yacy/crawler/data/NoticedURL.java
@@ -37,13 +37,13 @@ import java.util.Set;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.Balancer;
import net.yacy.crawler.CrawlSwitchboard;
import net.yacy.crawler.retrieval.Request;
import net.yacy.crawler.robots.RobotsTxt;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
public class NoticedURL {
@@ -64,7 +64,7 @@ public class NoticedURL {
final Set<String> myAgentIDs,
final boolean useTailCache,
final boolean exceed134217727) {
- Log.logInfo("NoticedURL", "CREATING STACKS at " + cachePath.toString());
+ ConcurrentLog.info("NoticedURL", "CREATING STACKS at " + cachePath.toString());
this.coreStack = new Balancer(cachePath, "urlNoticeCoreStack", minimumLocalDeltaInit, minimumGlobalDeltaInit, myAgentIDs, useTailCache, exceed134217727);
this.limitStack = new Balancer(cachePath, "urlNoticeLimitStack", minimumLocalDeltaInit, minimumGlobalDeltaInit, myAgentIDs, useTailCache, exceed134217727);
//overhangStack = new plasmaCrawlBalancer(overhangStackFile);
@@ -88,7 +88,7 @@ public class NoticedURL {
}
public void clear() {
- Log.logInfo("NoticedURL", "CLEARING ALL STACKS");
+ ConcurrentLog.info("NoticedURL", "CLEARING ALL STACKS");
if (this.coreStack != null) this.coreStack.clear();
if (this.limitStack != null) this.limitStack.clear();
if (this.remoteStack != null) this.remoteStack.clear();
@@ -96,7 +96,7 @@ public class NoticedURL {
}
protected void close() {
- Log.logInfo("NoticedURL", "CLOSING ALL STACKS");
+ ConcurrentLog.info("NoticedURL", "CLOSING ALL STACKS");
if (this.coreStack != null) {
this.coreStack.close();
this.coreStack = null;
@@ -119,7 +119,7 @@ public class NoticedURL {
@Override
protected void finalize() throws Throwable {
if ((this.coreStack != null) || (this.limitStack != null) || (this.remoteStack != null)) {
- Log.logWarning("plasmaCrawlNURL", "NURL stack closed by finalizer");
+ ConcurrentLog.warn("plasmaCrawlNURL", "NURL stack closed by finalizer");
close();
}
super.finalize();
@@ -182,7 +182,7 @@ public class NoticedURL {
default: return "stack type unknown";
}
} catch (final Exception er) {
- Log.logException(er);
+ ConcurrentLog.logException(er);
return "error pushing onto the crawl stack: " + er.getMessage();
}
}
@@ -213,7 +213,7 @@ public class NoticedURL {
try {ret |= this.remoteStack.remove(urlHashes) > 0;} catch (final IOException e) {}
return ret;
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
}
@@ -273,7 +273,7 @@ public class NoticedURL {
if (entry != null) {
final String warning = push(toStack, entry, robots);
if (warning != null) {
- Log.logWarning("NoticedURL", "shift from " + fromStack + " to " + toStack + ": " + warning);
+ ConcurrentLog.warn("NoticedURL", "shift from " + fromStack + " to " + toStack + ": " + warning);
}
}
} catch (final IOException e) {
@@ -282,7 +282,7 @@ public class NoticedURL {
}
public void clear(final StackType stackType) {
- Log.logInfo("NoticedURL", "CLEARING STACK " + stackType);
+ ConcurrentLog.info("NoticedURL", "CLEARING STACK " + stackType);
switch (stackType) {
case LOCAL: this.coreStack.clear(); break;
case GLOBAL: this.limitStack.clear(); break;
@@ -305,7 +305,7 @@ public class NoticedURL {
if (errors < 100) continue;
final int aftersize = balancer.size();
balancer.clear(); // the balancer is broken and cannot shrink
- Log.logWarning("BALANCER", "entry is null, balancer cannot shrink (bevore pop = " + s + ", after pop = " + aftersize + "); reset of balancer");
+ ConcurrentLog.warn("BALANCER", "entry is null, balancer cannot shrink (bevore pop = " + s + ", after pop = " + aftersize + "); reset of balancer");
}
return entry;
}
diff --git a/source/net/yacy/crawler/data/ZURL.java b/source/net/yacy/crawler/data/ZURL.java
index 5b805175d..9740c4525 100644
--- a/source/net/yacy/crawler/data/ZURL.java
+++ b/source/net/yacy/crawler/data/ZURL.java
@@ -41,13 +41,13 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.federate.solr.FailType;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.retrieval.Request;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.table.SplitTable;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.FileUtils;
@@ -55,7 +55,7 @@ import net.yacy.search.index.Fulltext;
public class ZURL implements Iterable<ZURL.Entry> {
- private static Log log = new Log("REJECTED");
+ private static ConcurrentLog log = new ConcurrentLog("REJECTED");
private static final int EcoFSBufferSize = 2000;
private static final int maxStackSize = 1000;
@@ -115,7 +115,7 @@ public class ZURL implements Iterable<ZURL.Entry> {
try {
this.urlIndex = new Table(f, rowdef, 0, 0, false, exceed134217727, true);
} catch (final SpaceExceededException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
//urlIndex = new kelondroFlexTable(cachePath, tablename, -1, rowdef, 0, true);
@@ -186,14 +186,14 @@ public class ZURL implements Iterable<ZURL.Entry> {
final Entry entry = new Entry(bentry, executor, workdate, workcount, reason);
put(entry);
this.stack.add(entry.hash());
- if (!reason.startsWith("double")) log.logInfo(bentry.url().toNormalform(true) + " - " + reason);
+ if (!reason.startsWith("double")) log.info(bentry.url().toNormalform(true) + " - " + reason);
if (this.fulltext.getDefaultConnector() != null && failCategory.store) {
// send the error to solr
try {
SolrInputDocument errorDoc = this.fulltext.getDefaultConfiguration().err(bentry.url(), failCategory.name() + " " + reason, failCategory.failType, httpcode);
this.fulltext.getDefaultConnector().add(errorDoc);
} catch (final IOException e) {
- Log.logWarning("SOLR", "failed to send error " + bentry.url().toNormalform(true) + " to solr: " + e.getMessage());
+ ConcurrentLog.warn("SOLR", "failed to send error " + bentry.url().toNormalform(true) + " to solr: " + e.getMessage());
}
}
while (this.stack.size() > maxStackSize) this.stack.poll();
@@ -247,7 +247,7 @@ public class ZURL implements Iterable<ZURL.Entry> {
if (entry == null) return null;
return new Entry(entry);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -271,7 +271,7 @@ public class ZURL implements Iterable<ZURL.Entry> {
if (this.urlIndex != null) this.urlIndex.put(newrow);
entry.stored = true;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/crawler/retrieval/FTPLoader.java b/source/net/yacy/crawler/retrieval/FTPLoader.java
index 414a247a8..8d2523b97 100644
--- a/source/net/yacy/crawler/retrieval/FTPLoader.java
+++ b/source/net/yacy/crawler/retrieval/FTPLoader.java
@@ -39,12 +39,12 @@ import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.ftp.FTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.Latency;
import net.yacy.crawler.data.ZURL.FailCategory;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
public class FTPLoader {
@@ -52,10 +52,10 @@ public class FTPLoader {
public static final long DEFAULT_MAXFILESIZE = 1024 * 1024 * 10;
private final Switchboard sb;
- private final Log log;
+ private final ConcurrentLog log;
private final long maxFileSize;
- public FTPLoader(final Switchboard sb, final Log log) {
+ public FTPLoader(final Switchboard sb, final ConcurrentLog log) {
this.sb = sb;
this.log = log;
this.maxFileSize = sb.getConfigLong("crawler.ftp.maxFileSize", -1l);
@@ -145,7 +145,7 @@ public class FTPLoader {
response = getFile(ftpClient, request, acceptOnlyParseable);
} catch (final Exception e) {
// add message to errorLog
- Log.logException(e);
+ ConcurrentLog.logException(e);
(new PrintStream(berr)).print(e.getMessage());
}
}
@@ -242,9 +242,9 @@ public class FTPLoader {
// only the metadata is returned
if (parserError != null) {
- this.log.logInfo("No parser available in FTP crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
+ this.log.info("No parser available in FTP crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
} else {
- this.log.logInfo("Too big file in FTP crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
+ this.log.info("Too big file in FTP crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
}
// create response with metadata only
diff --git a/source/net/yacy/crawler/retrieval/FileLoader.java b/source/net/yacy/crawler/retrieval/FileLoader.java
index 049f6b031..f7a6cf8d9 100644
--- a/source/net/yacy/crawler/retrieval/FileLoader.java
+++ b/source/net/yacy/crawler/retrieval/FileLoader.java
@@ -38,20 +38,20 @@ import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.ftp.FTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.search.Switchboard;
public class FileLoader {
private final Switchboard sb;
- private final Log log;
+ private final ConcurrentLog log;
private final int maxFileSize;
- public FileLoader(final Switchboard sb, final Log log) {
+ public FileLoader(final Switchboard sb, final ConcurrentLog log) {
this.sb = sb;
this.log = log;
this.maxFileSize = (int) sb.getConfigLong("crawler.file.maxFileSize", -1l);
@@ -115,9 +115,9 @@ public class FileLoader {
// only the metadata is returned
if (parserError != null) {
- this.log.logInfo("No parser available in File crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
+ this.log.info("No parser available in File crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
} else {
- this.log.logInfo("Too big file in File crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
+ this.log.info("Too big file in File crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
}
// create response with metadata only
diff --git a/source/net/yacy/crawler/retrieval/HTTPLoader.java b/source/net/yacy/crawler/retrieval/HTTPLoader.java
index 708ab342b..eed260701 100644
--- a/source/net/yacy/crawler/retrieval/HTTPLoader.java
+++ b/source/net/yacy/crawler/retrieval/HTTPLoader.java
@@ -33,13 +33,13 @@ import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.http.HTTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.Latency;
import net.yacy.crawler.data.ZURL.FailCategory;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.ByteCount;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
@@ -60,9 +60,9 @@ public final class HTTPLoader {
*/
private final int socketTimeout;
private final Switchboard sb;
- private final Log log;
+ private final ConcurrentLog log;
- public HTTPLoader(final Switchboard sb, final Log theLog) {
+ public HTTPLoader(final Switchboard sb, final ConcurrentLog theLog) {
this.sb = sb;
this.log = theLog;
@@ -154,8 +154,8 @@ public final class HTTPLoader {
final DigestURI redirectionUrl = DigestURI.newURL(request.url(), redirectionUrlString);
// restart crawling with new url
- this.log.logInfo("CRAWLER Redirection detected ('" + client.getHttpResponse().getStatusLine() + "') for URL " + requestURLString);
- this.log.logInfo("CRAWLER ..Redirecting request to: " + redirectionUrl);
+ this.log.info("CRAWLER Redirection detected ('" + client.getHttpResponse().getStatusLine() + "') for URL " + requestURLString);
+ this.log.info("CRAWLER ..Redirecting request to: " + redirectionUrl);
this.sb.webStructure.generateCitationReference(url, redirectionUrl);
diff --git a/source/net/yacy/crawler/retrieval/RSSLoader.java b/source/net/yacy/crawler/retrieval/RSSLoader.java
index 15e723679..5a0c65bc9 100644
--- a/source/net/yacy/crawler/retrieval/RSSLoader.java
+++ b/source/net/yacy/crawler/retrieval/RSSLoader.java
@@ -42,13 +42,13 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.storage.ARC;
import net.yacy.cora.storage.ComparableARC;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.HarvestProcess;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -75,14 +75,14 @@ public class RSSLoader extends Thread {
final byte[] resource = response == null ? null : response.getContent();
rss = resource == null ? null : RSSReader.parse(RSSFeed.DEFAULT_MAXSIZE, resource);
} catch (final MalformedURLException e) {
- Log.logWarning("Load_RSS", "rss loading for url '" + getName().substring(9) + "' failed: " + e.getMessage());
+ ConcurrentLog.warn("Load_RSS", "rss loading for url '" + getName().substring(9) + "' failed: " + e.getMessage());
return;
} catch (final IOException e) {
- Log.logWarning("Load_RSS", "rss loading for url '" + this.urlf.toNormalform(true) + "' failed: " + e.getMessage());
+ ConcurrentLog.warn("Load_RSS", "rss loading for url '" + this.urlf.toNormalform(true) + "' failed: " + e.getMessage());
return;
}
if (rss == null) {
- Log.logWarning("Load_RSS", "no rss for url " + this.urlf.toNormalform(true));
+ ConcurrentLog.warn("Load_RSS", "no rss for url " + this.urlf.toNormalform(true));
return;
}
final RSSFeed feed = rss.getFeed();
@@ -102,7 +102,7 @@ public class RSSLoader extends Thread {
if (indexTriggered.containsKey(messageurl.hash())) continue;
urlmap.put(ASCII.String(messageurl.hash()), messageurl);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
Map<String, HarvestProcess> existingids = sb.urlExists(urlmap.keySet());
@@ -132,9 +132,9 @@ public class RSSLoader extends Thread {
rssRow.put("avg_upd_per_day", nextAvg);
sb.tables.update("rss", url.hash(), rssRow);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -162,7 +162,7 @@ public class RSSLoader extends Thread {
try {
sb.tables.update("rss", url.hash(), rssRow);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
\ No newline at end of file
diff --git a/source/net/yacy/crawler/retrieval/SMBLoader.java b/source/net/yacy/crawler/retrieval/SMBLoader.java
index 3b120c240..8e76e025e 100644
--- a/source/net/yacy/crawler/retrieval/SMBLoader.java
+++ b/source/net/yacy/crawler/retrieval/SMBLoader.java
@@ -46,10 +46,10 @@ import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.ftp.FTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.search.Switchboard;
@@ -58,10 +58,10 @@ public class SMBLoader {
public static final long DEFAULT_MAXFILESIZE = 1024 * 1024 * 10;
private final Switchboard sb;
- private final Log log;
+ private final ConcurrentLog log;
private final long maxFileSize;
- public SMBLoader(final Switchboard sb, final Log log) {
+ public SMBLoader(final Switchboard sb, final ConcurrentLog log) {
this.sb = sb;
this.log = log;
this.maxFileSize = sb.getConfigLong("crawler.smb.maxFileSize", -1l);
@@ -133,9 +133,9 @@ public class SMBLoader {
// only the metadata is returned
if (parserError != null) {
- this.log.logInfo("No parser available in SMB crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
+ this.log.info("No parser available in SMB crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
} else {
- this.log.logInfo("Too big file in SMB crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
+ this.log.info("Too big file in SMB crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
}
// create response with metadata only
@@ -186,13 +186,13 @@ public class SMBLoader {
}
}
} catch (SmbException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (UnknownHostException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/crawler/retrieval/SitemapImporter.java b/source/net/yacy/crawler/retrieval/SitemapImporter.java
index e75e93c70..fa4a8fedf 100644
--- a/source/net/yacy/crawler/retrieval/SitemapImporter.java
+++ b/source/net/yacy/crawler/retrieval/SitemapImporter.java
@@ -29,19 +29,19 @@ import java.net.MalformedURLException;
import java.util.Date;
import net.yacy.cora.document.ASCII;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.HarvestProcess;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.document.parser.sitemapParser;
import net.yacy.document.parser.sitemapParser.URLEntry;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
public class SitemapImporter extends Thread {
private CrawlProfile crawlingProfile = null;
- private static final Log logger = new Log("SITEMAP");
+ private static final ConcurrentLog logger = new ConcurrentLog("SITEMAP");
private DigestURI siteMapURL = null;
private final Switchboard sb;
@@ -56,7 +56,7 @@ public class SitemapImporter extends Thread {
@Override
public void run() {
try {
- logger.logInfo("Start parsing sitemap file " + this.siteMapURL);
+ logger.info("Start parsing sitemap file " + this.siteMapURL);
sitemapParser.SitemapReader parser = sitemapParser.parse(this.siteMapURL);
parser.start();
URLEntry item;
@@ -64,7 +64,7 @@ public class SitemapImporter extends Thread {
process(item);
}
} catch (final Exception e) {
- logger.logWarning("Unable to parse sitemap file " + this.siteMapURL, e);
+ logger.warn("Unable to parse sitemap file " + this.siteMapURL, e);
}
}
@@ -108,6 +108,6 @@ public class SitemapImporter extends Thread {
0,
0
));
- logger.logInfo("New URL '" + entry.url() + "' added for loading.");
+ logger.info("New URL '" + entry.url() + "' added for loading.");
}
}
diff --git a/source/net/yacy/data/BlogBoard.java b/source/net/yacy/data/BlogBoard.java
index 48df094de..f18760ac1 100644
--- a/source/net/yacy/data/BlogBoard.java
+++ b/source/net/yacy/data/BlogBoard.java
@@ -52,10 +52,10 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.protocol.Domains;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.wiki.WikiBoard;
import net.yacy.kelondro.blob.MapHeap;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.kelondroException;
import org.w3c.dom.Document;
@@ -130,9 +130,9 @@ public class BlogBoard {
this.database.insert(UTF8.getBytes(page.key), page.record);
ret = page.key;
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (SpaceExceededException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
return ret;
}
@@ -147,10 +147,10 @@ public class BlogBoard {
try {
record = base.get(UTF8.getBytes(normalized.substring(0, Math.min(normalized.length(), KEY_LENGTH))));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
record = null;
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
record = null;
}
return (record == null) ?
@@ -164,11 +164,11 @@ public class BlogBoard {
final DocumentBuilder builder = factory.newDocumentBuilder();
return parseXMLimport(builder.parse(new ByteArrayInputStream(UTF8.getBytes(input))));
} catch (final ParserConfigurationException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (final SAXException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (final IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
return false;
@@ -399,8 +399,8 @@ public class BlogBoard {
try {
final String date = this.record.get("date");
if (date == null) {
- if (Log.isFinest("Blog")) {
- Log.logFinest("Blog", "ERROR: date field missing in blogBoard");
+ if (ConcurrentLog.isFinest("Blog")) {
+ ConcurrentLog.finest("Blog", "ERROR: date field missing in blogBoard");
}
return new Date();
}
@@ -421,8 +421,8 @@ public class BlogBoard {
public String getTimestamp() {
final String timestamp = this.record.get("date");
if (timestamp == null) {
- if (Log.isFinest("Blog")) {
- Log.logFinest("Blog", "ERROR: date field missing in blogBoard");
+ if (ConcurrentLog.isFinest("Blog")) {
+ ConcurrentLog.finest("Blog", "ERROR: date field missing in blogBoard");
}
return GenericFormatter.SHORT_SECOND_FORMATTER.format();
}
diff --git a/source/net/yacy/data/BlogBoardComments.java b/source/net/yacy/data/BlogBoardComments.java
index e3b68ccd8..719e0cf38 100644
--- a/source/net/yacy/data/BlogBoardComments.java
+++ b/source/net/yacy/data/BlogBoardComments.java
@@ -49,10 +49,10 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.protocol.Domains;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.wiki.WikiBoard;
import net.yacy.kelondro.blob.MapHeap;
-import net.yacy.kelondro.logging.Log;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -120,7 +120,7 @@ public class BlogBoardComments {
this.database.insert(UTF8.getBytes(page.key), page.record);
return page.key;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -136,10 +136,10 @@ public class BlogBoardComments {
try {
record = base.get(UTF8.getBytes(copyOfKey));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
record = null;
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
record = null;
}
return (record == null) ?
@@ -285,7 +285,7 @@ public class BlogBoardComments {
try {
final String date = this.record.get("date");
if (date == null) {
- if (Log.isFinest("Blog")) Log.logFinest("Blog", "ERROR: date field missing in blogBoard");
+ if (ConcurrentLog.isFinest("Blog")) ConcurrentLog.finest("Blog", "ERROR: date field missing in blogBoard");
return new Date();
}
synchronized (SIMPLE_DATE_FORMATTER) {
@@ -299,7 +299,7 @@ public class BlogBoardComments {
public String getTimestamp() {
final String timestamp = this.record.get("date");
if (timestamp == null) {
- if (Log.isFinest("Blog")) Log.logFinest("Blog", "ERROR: date field missing in blogBoard");
+ if (ConcurrentLog.isFinest("Blog")) ConcurrentLog.finest("Blog", "ERROR: date field missing in blogBoard");
return dateString(new Date());
}
return timestamp;
diff --git a/source/net/yacy/data/BookmarkDate.java b/source/net/yacy/data/BookmarkDate.java
index 164c52871..9cf685665 100644
--- a/source/net/yacy/data/BookmarkDate.java
+++ b/source/net/yacy/data/BookmarkDate.java
@@ -40,10 +40,10 @@ import java.util.Map;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.BookmarksDB.Bookmark;
import net.yacy.kelondro.blob.MapHeap;
-import net.yacy.kelondro.logging.Log;
public class BookmarkDate {
@@ -75,7 +75,7 @@ public class BookmarkDate {
// rebuilds the datesDB from the bookmarksDB
public void init(final Iterator<Bookmark> it) {
- Log.logInfo("BOOKMARKS", "start init dates.db from bookmarks.db...");
+ ConcurrentLog.info("BOOKMARKS", "start init dates.db from bookmarks.db...");
Bookmark bookmark;
String date;
Entry bmDate;
@@ -91,7 +91,7 @@ public class BookmarkDate {
bmDate.setDatesTable();
count++;
}
- Log.logInfo("BOOKMARKS", "finished init "+datesTable.size()+" dates using " + count + " bookmarks.");
+ ConcurrentLog.info("BOOKMARKS", "finished init "+datesTable.size()+" dates using " + count + " bookmarks.");
}
/**
@@ -149,13 +149,13 @@ public class BookmarkDate {
try {
datesTable.insert(UTF8.getBytes(getDateString()), mem);
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
try {
datesTable.delete(UTF8.getBytes(getDateString()));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/data/BookmarkHelper.java b/source/net/yacy/data/BookmarkHelper.java
index ade6df6db..ecdc33cdb 100644
--- a/source/net/yacy/data/BookmarkHelper.java
+++ b/source/net/yacy/data/BookmarkHelper.java
@@ -49,13 +49,13 @@ import javax.xml.parsers.ParserConfigurationException;
import net.yacy.cora.date.ISO8601Formatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.BookmarksDB.Bookmark;
import net.yacy.data.BookmarksDB.Tag;
import net.yacy.document.parser.html.ContentScraper;
import net.yacy.document.parser.html.TransformerWriter;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import org.w3c.dom.Document;
@@ -146,11 +146,11 @@ public class BookmarkHelper {
FileUtils.copy(input,writer);
writer.close();
links = scraper.getAnchors();
- } catch (final IOException e) { Log.logWarning("BOOKMARKS", "error during load of links: "+ e.getClass() +" "+ e.getMessage());}
+ } catch (final IOException e) { ConcurrentLog.warn("BOOKMARKS", "error during load of links: "+ e.getClass() +" "+ e.getMessage());}
for (final Entry<DigestURI, Properties> link: links.entrySet()) {
url = link.getKey();
title = link.getValue().getProperty("name", "");
- Log.logInfo("BOOKMARKS", "links.get(url)");
+ ConcurrentLog.info("BOOKMARKS", "links.get(url)");
if ("".equals(title)) {//cannot be displayed
title = url.toString();
}
diff --git a/source/net/yacy/data/BookmarksDB.java b/source/net/yacy/data/BookmarksDB.java
index 9f98c9b4f..543e0b979 100644
--- a/source/net/yacy/data/BookmarksDB.java
+++ b/source/net/yacy/data/BookmarksDB.java
@@ -39,9 +39,9 @@ import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.blob.MapHeap;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
public class BookmarksDB {
@@ -75,7 +75,7 @@ public class BookmarksDB {
// tags
this.tags = new ConcurrentHashMap<String, Tag>();
- Log.logInfo("BOOKMARKS", "started init of tags from bookmarks.db...");
+ ConcurrentLog.info("BOOKMARKS", "started init of tags from bookmarks.db...");
final Iterator<Bookmark> it = new bookmarkIterator(true);
Bookmark bookmark;
Tag tag;
@@ -99,7 +99,7 @@ public class BookmarksDB {
putTag(tag);
}
}
- Log.logInfo("BOOKMARKS", "finished init " + this.tags.size() + " tags using your "+this.bookmarks.size()+" bookmarks.");
+ ConcurrentLog.info("BOOKMARKS", "finished init " + this.tags.size() + " tags using your "+this.bookmarks.size()+" bookmarks.");
// dates
final boolean datesExisted = datesFile.exists();
@@ -144,7 +144,7 @@ public class BookmarksDB {
try {
this.bookmarks.insert(ASCII.getBytes(bookmark.getUrlHash()), bookmark.entry);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
public String addBookmark(final Bookmark bookmark){
@@ -196,7 +196,7 @@ public class BookmarksDB {
try {
it = new bookmarkIterator(true);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return set.iterator();
}
Bookmark bm;
diff --git a/source/net/yacy/data/DidYouMean.java b/source/net/yacy/data/DidYouMean.java
index 47540b002..95e2b8388 100644
--- a/source/net/yacy/data/DidYouMean.java
+++ b/source/net/yacy/data/DidYouMean.java
@@ -10,9 +10,9 @@ import java.util.concurrent.LinkedBlockingQueue;
import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.StringBuilderComparator;
import net.yacy.document.LibraryProvider;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.index.Segment;
@@ -144,7 +144,7 @@ public class DidYouMean {
}
final SortedSet<StringBuilder> preSorted = getSuggestions(timeout);
if (System.currentTimeMillis() > timelimit) {
- Log.logInfo("DidYouMean", "found and returned " + preSorted.size() + " unsorted suggestions (1); execution time: "
+ ConcurrentLog.info("DidYouMean", "found and returned " + preSorted.size() + " unsorted suggestions (1); execution time: "
+ (System.currentTimeMillis() - startTime) + "ms");
return preSorted;
}
@@ -177,11 +177,11 @@ public class DidYouMean {
// finished
if (countSorted.isEmpty()) {
- Log.logInfo("DidYouMean", "found and returned " + preSorted.size() + " unsorted suggestions (2); execution time: "
+ ConcurrentLog.info("DidYouMean", "found and returned " + preSorted.size() + " unsorted suggestions (2); execution time: "
+ (System.currentTimeMillis() - startTime) + "ms");
return preSorted;
}
- Log.logInfo("DidYouMean", "found " + preSorted.size() + " unsorted terms, returned " + countSorted.size() + " sorted suggestions; execution time: "
+ ConcurrentLog.info("DidYouMean", "found " + preSorted.size() + " unsorted terms, returned " + countSorted.size() + " sorted suggestions; execution time: "
+ (System.currentTimeMillis() - startTime) + "ms");
return countSorted;
diff --git a/source/net/yacy/data/MessageBoard.java b/source/net/yacy/data/MessageBoard.java
index c2397eb03..cee3e015d 100644
--- a/source/net/yacy/data/MessageBoard.java
+++ b/source/net/yacy/data/MessageBoard.java
@@ -35,9 +35,9 @@ import java.util.TimeZone;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.MapHeap;
-import net.yacy.kelondro.logging.Log;
public class MessageBoard {
@@ -187,7 +187,7 @@ public class MessageBoard {
database.insert(UTF8.getBytes(message.key), message.record);
return message.key;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -197,10 +197,10 @@ public class MessageBoard {
try {
record = database.get(UTF8.getBytes(key));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
return new entry(key, record);
diff --git a/source/net/yacy/data/Translator.java b/source/net/yacy/data/Translator.java
index f04e86811..6ed1d7489 100644
--- a/source/net/yacy/data/Translator.java
+++ b/source/net/yacy/data/Translator.java
@@ -46,7 +46,7 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.Formatter;
import net.yacy.server.serverSwitch;
@@ -73,7 +73,7 @@ public class Translator {
} else {
//Filename not available, but it will be printed in Log
//after all untranslated Strings as "Translated file: "
- if (Log.isFine("TRANSLATOR")) Log.logFine("TRANSLATOR", "Unused String: "+key);
+ if (ConcurrentLog.isFine("TRANSLATOR")) ConcurrentLog.fine("TRANSLATOR", "Unused String: "+key);
}
}
return result;
@@ -187,17 +187,17 @@ public class Translator {
relativePath=sourceFile.getAbsolutePath().substring(baseDir.getAbsolutePath().length()+1); //+1 to get the "/"
relativePath = relativePath.replace(File.separatorChar, '/');
} catch (final IndexOutOfBoundsException e) {
- Log.logSevere("TRANSLATOR", "Error creating relative Path for "+sourceFile.getAbsolutePath());
+ ConcurrentLog.severe("TRANSLATOR", "Error creating relative Path for "+sourceFile.getAbsolutePath());
relativePath = "wrong path"; //not in translationLists
}
if (translationLists.containsKey(relativePath)) {
- Log.logInfo("TRANSLATOR", "Translating file: "+ relativePath);
+ ConcurrentLog.info("TRANSLATOR", "Translating file: "+ relativePath);
if(!translateFile(
sourceFile,
new File(destDir, sourceFile.getName().replace('/', File.separatorChar)),
translationLists.get(relativePath)))
{
- Log.logSevere("TRANSLATOR", "File error while translating file "+relativePath);
+ ConcurrentLog.severe("TRANSLATOR", "File error while translating file "+relativePath);
}
//}else{
//serverLog.logInfo("TRANSLATOR", "No translation for file: "+relativePath);
diff --git a/source/net/yacy/data/UserDB.java b/source/net/yacy/data/UserDB.java
index e0d3e31ac..f5a5e3ac6 100644
--- a/source/net/yacy/data/UserDB.java
+++ b/source/net/yacy/data/UserDB.java
@@ -42,9 +42,9 @@ import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.Digest;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.MapHeap;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.kelondroException;
@@ -74,7 +74,7 @@ public final class UserDB {
try {
userTable = new MapHeap(userTableFile, 128, NaturalOrder.naturalOrder, 1024 * 64, 10, '_');
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -90,7 +90,7 @@ public final class UserDB {
try {
userTable.delete(UTF8.getBytes(hostName.toLowerCase()));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -102,9 +102,9 @@ public final class UserDB {
try {
record = userTable.get(UTF8.getBytes(userName));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return (record != null) ? new Entry(userName, record) : null;
@@ -120,7 +120,7 @@ public final class UserDB {
userTable.insert(UTF8.getBytes(entry.userName), entry.mem);
return entry.userName;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -208,7 +208,7 @@ public final class UserDB {
try {
entry.setProperty(Entry.LOGGED_OUT, "false");
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return entry;
}
@@ -233,7 +233,7 @@ public final class UserDB {
try {
entry.setProperty(Entry.LOGGED_OUT, "false");
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return null;
}
@@ -395,13 +395,13 @@ public final class UserDB {
try{
ret = Long.parseLong(s);
} catch (final NumberFormatException e){
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
try {
this.setProperty(TIME_USED,"0");
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return ret;
@@ -414,13 +414,13 @@ public final class UserDB {
try {
ret = Long.parseLong(s);
} catch (final NumberFormatException e){
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
try {
this.setProperty(TIME_LIMIT, "0");
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return ret;
@@ -433,13 +433,13 @@ public final class UserDB {
try {
ret = Long.parseLong(s);
} catch (final NumberFormatException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
try {
this.setProperty(TRAFFIC_SIZE, "0");
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return ret;
@@ -459,7 +459,7 @@ public final class UserDB {
try {
this.setProperty(TRAFFIC_SIZE,Long.toString(newTrafficSize));
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return newTrafficSize;
}
@@ -524,7 +524,7 @@ public final class UserDB {
try {
UserDB.this.userTable.insert(UTF8.getBytes(getUserName()), this.mem);
} catch(final Exception e){
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return newTimeUsed;
}
@@ -568,7 +568,7 @@ public final class UserDB {
ipUsers.remove(ip);
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/data/WorkTables.java b/source/net/yacy/data/WorkTables.java
index e6128ed4a..8a057bbd7 100644
--- a/source/net/yacy/data/WorkTables.java
+++ b/source/net/yacy/data/WorkTables.java
@@ -45,12 +45,12 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.WordReference;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.IndexCell;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
@@ -116,9 +116,9 @@ public class WorkTables extends Tables {
try {
row = (pk == null) ? null : super.select(TABLE_API_NAME, pk);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// insert or update entry
@@ -150,11 +150,11 @@ public class WorkTables extends Tables {
assert pk != null;
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- Log.logInfo("APICALL", apiurl);
+ ConcurrentLog.info("APICALL", apiurl);
return pk;
}
@@ -201,11 +201,11 @@ public class WorkTables extends Tables {
calculateAPIScheduler(data, false); // set next execution time
pk = super.insert(TABLE_API_NAME, data);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- Log.logInfo("APICALL", apiurl);
+ ConcurrentLog.info("APICALL", apiurl);
return pk;
}
@@ -231,19 +231,19 @@ public class WorkTables extends Tables {
try {
row = select(WorkTables.TABLE_API_NAME, UTF8.getBytes(pk));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (row == null) continue;
url = "http://" + host + ":" + port + UTF8.String(row.get(WorkTables.TABLE_API_COL_URL));
url += "&" + WorkTables.TABLE_API_COL_APICALL_PK + "=" + UTF8.String(row.getPK());
- Log.logInfo("WorkTables", "executing url: " + url);
+ ConcurrentLog.info("WorkTables", "executing url: " + url);
try {
client.GETbytes(url);
l.put(url, client.getStatusCode());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
l.put(url, -1);
}
}
@@ -261,7 +261,7 @@ public class WorkTables extends Tables {
client.GETbytes(url);
return client.getStatusCode();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return -1;
}
}
@@ -343,7 +343,7 @@ public class WorkTables extends Tables {
data.put(TABLE_SEARCH_FAILURE_COL_COMMENT, UTF8.getBytes(reason));
super.insert(TABLE_SEARCH_FAILURE_NAME, url.hash(), data);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -351,7 +351,7 @@ public class WorkTables extends Tables {
try {
return super.has(TABLE_SEARCH_FAILURE_NAME, urlhash);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
}
@@ -374,7 +374,7 @@ public class WorkTables extends Tables {
}
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -390,7 +390,7 @@ public class WorkTables extends Tables {
comments.put(row.getPK(), UTF8.String(row.get(WorkTables.TABLE_API_COL_COMMENT)));
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return comments;
}
diff --git a/source/net/yacy/data/wiki/WikiBoard.java b/source/net/yacy/data/wiki/WikiBoard.java
index ecc4d2246..19704f559 100644
--- a/source/net/yacy/data/wiki/WikiBoard.java
+++ b/source/net/yacy/data/wiki/WikiBoard.java
@@ -41,9 +41,9 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.MapHeap;
-import net.yacy.kelondro.logging.Log;
/**
*
@@ -377,7 +377,7 @@ public class WikiBoard {
this.datbase.insert(UTF8.getBytes(entry.key), entry.record);
key = entry.key;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return key;
}
@@ -407,9 +407,9 @@ public class WikiBoard {
final Map<String, String> record = base.get(UTF8.getBytes(copyOfKey));
ret = (record == null) ? newEntry(copyOfKey, ANONYMOUS, Domains.LOCALHOST, "New Page", UTF8.getBytes("")) : new Entry(copyOfKey, record);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return ret;
}
diff --git a/source/net/yacy/data/ymark/YMarkAutoTagger.java b/source/net/yacy/data/ymark/YMarkAutoTagger.java
index f72266176..f456a4f00 100644
--- a/source/net/yacy/data/ymark/YMarkAutoTagger.java
+++ b/source/net/yacy/data/ymark/YMarkAutoTagger.java
@@ -13,6 +13,7 @@ import java.util.concurrent.ArrayBlockingQueue;
import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Response;
import net.yacy.document.Condenser;
import net.yacy.document.Document;
@@ -22,7 +23,6 @@ import net.yacy.document.SentenceReader;
import net.yacy.document.WordTokenizer;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.LoaderDispatcher;
import net.yacy.search.snippet.TextSnippet;
@@ -66,14 +66,14 @@ public class YMarkAutoTagger implements Runnable, Thread.UncaughtExceptionHandle
try {
uri = new DigestURI(url);
} catch (final MalformedURLException e) {
- Log.logWarning(YMarkTables.BOOKMARKS_LOG, "loadDocument failed due to malformed url: "+url);
+ ConcurrentLog.warn(YMarkTables.BOOKMARKS_LOG, "loadDocument failed due to malformed url: "+url);
return null;
}
response = loader.load(loader.request(uri, true, false), CacheStrategy.IFEXIST, Integer.MAX_VALUE, null, TextSnippet.snippetMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
try {
return Document.mergeDocuments(response.url(), response.getMimeType(), response.parse());
} catch (final Failure e) {
- Log.logWarning(YMarkTables.BOOKMARKS_LOG, "loadDocument failed due to a parser failure for url: "+url);
+ ConcurrentLog.warn(YMarkTables.BOOKMARKS_LOG, "loadDocument failed due to a parser failure for url: "+url);
return null;
}
}
@@ -267,16 +267,16 @@ public class YMarkAutoTagger implements Runnable, Thread.UncaughtExceptionHandle
}
}
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logWarning(YMarkTables.BOOKMARKS_LOG.toString(), "autoTagger - IOException for URL: "+url);
+ ConcurrentLog.warn(YMarkTables.BOOKMARKS_LOG.toString(), "autoTagger - IOException for URL: "+url);
} finally {
}
}
@Override
public void uncaughtException(final Thread t, final Throwable e) {
- Log.logWarning(YMarkTables.BOOKMARKS_LOG, "I caught an uncaughtException in thread "+t.getName());
- Log.logException(e);
+ ConcurrentLog.warn(YMarkTables.BOOKMARKS_LOG, "I caught an uncaughtException in thread "+t.getName());
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/data/ymark/YMarkEntry.java b/source/net/yacy/data/ymark/YMarkEntry.java
index 2a3ab6a9b..66f5b66b1 100644
--- a/source/net/yacy/data/ymark/YMarkEntry.java
+++ b/source/net/yacy/data/ymark/YMarkEntry.java
@@ -33,11 +33,11 @@ import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.document.content.DCEntry;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
public class YMarkEntry extends TreeMap<String, String> {
@@ -209,7 +209,7 @@ public class YMarkEntry extends TreeMap<String, String> {
try {
return YMarkUtil.getBookmarkId(this.get(YMarkEntry.BOOKMARK.URL.key()));
} catch (MalformedURLException e) {
- Log.logWarning(YMarkTables.BOOKMARKS_LOG, "getUrlHash - MalformedURLException for YMarkEntry: "+this.get(YMarkEntry.BOOKMARK.URL.key()));
+ ConcurrentLog.warn(YMarkTables.BOOKMARKS_LOG, "getUrlHash - MalformedURLException for YMarkEntry: "+this.get(YMarkEntry.BOOKMARK.URL.key()));
}
return null;
}
diff --git a/source/net/yacy/data/ymark/YMarkHTMLImporter.java b/source/net/yacy/data/ymark/YMarkHTMLImporter.java
index f8fbedc97..cdeb9334f 100644
--- a/source/net/yacy/data/ymark/YMarkHTMLImporter.java
+++ b/source/net/yacy/data/ymark/YMarkHTMLImporter.java
@@ -31,7 +31,7 @@ import javax.swing.text.html.HTML;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.parser.ParserDelegator;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class YMarkHTMLImporter extends YMarkImporter {
@@ -93,7 +93,7 @@ public class YMarkHTMLImporter extends YMarkImporter {
this.folderstring.append(data);
break;
case FOLDER_DESC:
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, "YMarksHTMLImporter - folder: "+this.folderstring+" desc: " + new String(data));
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, "YMarksHTMLImporter - folder: "+this.folderstring+" desc: " + new String(data));
break;
case BMK_DESC:
this.bmk.put(YMarkEntry.BOOKMARK.DESC.key(), new String(data));
@@ -110,7 +110,7 @@ public class YMarkHTMLImporter extends YMarkImporter {
bookmarks.put(this.bmk);
bmk = new YMarkEntry();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
final String url = (String)a.getAttribute(HTML.Attribute.HREF);
@@ -120,7 +120,7 @@ public class YMarkHTMLImporter extends YMarkImporter {
sb.setLength(0);
if (a.isDefined(bmk.html_attrb())) {
sb.append((String)a.getAttribute(bmk.html_attrb()));
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, bmk.key()+" : "+sb.toString());
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, bmk.key()+" : "+sb.toString());
}
switch(bmk) {
case TAGS:
@@ -165,7 +165,7 @@ public class YMarkHTMLImporter extends YMarkImporter {
try {
bookmarks.put(this.bmk);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/data/ymark/YMarkImporter.java b/source/net/yacy/data/ymark/YMarkImporter.java
index d4dc85bc8..17e4b129a 100644
--- a/source/net/yacy/data/ymark/YMarkImporter.java
+++ b/source/net/yacy/data/ymark/YMarkImporter.java
@@ -25,7 +25,7 @@ package net.yacy.data.ymark;
import java.io.IOException;
import java.util.concurrent.ArrayBlockingQueue;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
public abstract class YMarkImporter implements Runnable {
@@ -52,13 +52,13 @@ public abstract class YMarkImporter implements Runnable {
try {
parse();
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, this.importer+" Importer inserted poison pill in queue");
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, this.importer+" Importer inserted poison pill in queue");
this.bookmarks.put(YMarkEntry.POISON);
} catch (InterruptedException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
}
@@ -67,7 +67,7 @@ public abstract class YMarkImporter implements Runnable {
try {
return this.bookmarks.take();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -138,17 +138,17 @@ public abstract class YMarkImporter implements Runnable {
}
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
if(this.autotag) {
try {
this.autoTaggingQueue.put(YMarkAutoTagger.POISON);
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, YMarkImporter.this.importer+" inserted poison pill into autoTagging queue");
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, YMarkImporter.this.importer+" inserted poison pill into autoTagging queue");
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/data/ymark/YMarkJSONImporter.java b/source/net/yacy/data/ymark/YMarkJSONImporter.java
index 68aa86133..6335092af 100644
--- a/source/net/yacy/data/ymark/YMarkJSONImporter.java
+++ b/source/net/yacy/data/ymark/YMarkJSONImporter.java
@@ -5,7 +5,7 @@ import java.io.Reader;
import java.util.HashMap;
import java.util.concurrent.ArrayBlockingQueue;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.json.simple.parser.ContentHandler;
import org.json.simple.parser.JSONParser;
@@ -119,7 +119,7 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
try {
this.bookmarks.put(this.bmk);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.bmk = new YMarkEntry();
}
@@ -167,18 +167,18 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
public void run() {
try {
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, "JSON Importer run()");
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, "JSON Importer run()");
this.parser.parse(this.bmk_file, this, true);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (ParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, "JSON Importer inserted poison pill in queue");
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, "JSON Importer inserted poison pill in queue");
this.bookmarks.put(YMarkEntry.POISON);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -187,7 +187,7 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
try {
return this.bookmarks.take();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/data/ymark/YMarkTables.java b/source/net/yacy/data/ymark/YMarkTables.java
index 21289fdd8..a54526e3b 100644
--- a/source/net/yacy/data/ymark/YMarkTables.java
+++ b/source/net/yacy/data/ymark/YMarkTables.java
@@ -43,6 +43,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import net.yacy.cora.document.ASCII;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.WorkTables;
import net.yacy.document.Document;
@@ -52,7 +53,6 @@ import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.blob.Tables.Row;
import net.yacy.kelondro.blob.TablesColumnIndex;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.LoaderDispatcher;
public class YMarkTables {
@@ -142,14 +142,14 @@ public class YMarkTables {
final long time = System.currentTimeMillis();
final TablesColumnIndex index = this.worktables.getIndex(bmk_table);
if(index.getType() == TablesColumnIndex.INDEXTYPE.RAM || index.size() == 0) {
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, "buildIndex() "+YMarkEntry.BOOKMARK.indexColumns().keySet().toString());
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, "buildIndex() "+YMarkEntry.BOOKMARK.indexColumns().keySet().toString());
index.buildIndex(YMarkEntry.BOOKMARK.indexColumns(), this.worktables.iterator(bmk_table));
- Log.logInfo(YMarkTables.BOOKMARKS_LOG, "build "+index.getType().name()+" index for columns "+YMarkEntry.BOOKMARK.indexColumns().keySet().toString()
+ ConcurrentLog.info(YMarkTables.BOOKMARKS_LOG, "build "+index.getType().name()+" index for columns "+YMarkEntry.BOOKMARK.indexColumns().keySet().toString()
+" of table "+bmk_table+" containing "+this.worktables.size(bmk_table)+ " bookmarks"
+" ("+(System.currentTimeMillis()-time)+"ms)");
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (TableColumnIndexException e) {
// currently nothing to do...
}
@@ -248,7 +248,7 @@ public class YMarkTables {
if (!root.equals(YMarkTables.FOLDERS_ROOT)) { folders.add(root); }
return folders;
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -413,7 +413,7 @@ public class YMarkTables {
try {
urlHash = YMarkUtil.getBookmarkId(bmk.get(YMarkEntry.BOOKMARK.URL.key()));
} catch (MalformedURLException e) {
- Log.logInfo("BOOKMARKIMPORT", "invalid url: "+bmk.get(YMarkEntry.BOOKMARK.URL.key()));
+ ConcurrentLog.info("BOOKMARKIMPORT", "invalid url: "+bmk.get(YMarkEntry.BOOKMARK.URL.key()));
}
Tables.Row bmk_row = null;
diff --git a/source/net/yacy/data/ymark/YMarkXBELImporter.java b/source/net/yacy/data/ymark/YMarkXBELImporter.java
index a264b2284..2a286d87c 100644
--- a/source/net/yacy/data/ymark/YMarkXBELImporter.java
+++ b/source/net/yacy/data/ymark/YMarkXBELImporter.java
@@ -30,7 +30,7 @@ import java.text.ParseException;
import java.util.HashMap;
import java.util.HashSet;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
@@ -218,7 +218,7 @@ public class YMarkXBELImporter extends YMarkImporter {
bookmarks.put(this.bmk);
bmk = new YMarkEntry();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
this.outer_state = XBEL.FOLDER;
diff --git a/source/net/yacy/dbtest.java b/source/net/yacy/dbtest.java
index 5652d91fc..d72721b92 100644
--- a/source/net/yacy/dbtest.java
+++ b/source/net/yacy/dbtest.java
@@ -15,11 +15,11 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.RowSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.table.SQLTable;
import net.yacy.kelondro.table.SplitTable;
import net.yacy.kelondro.table.Table;
@@ -132,11 +132,11 @@ public class dbtest {
if (getTable_reference() != null) getTable_reference().put(getTable_test().row().newEntry(new byte[][] { entry.getKey(), entry.getValue() , entry.getValue() }));
} catch (final IOException e) {
System.err.println(e);
- Log.logException(e);
+ ConcurrentLog.logException(e);
System.exit(0);
} catch (final SpaceExceededException e) {
System.err.println(e);
- Log.logException(e);
+ ConcurrentLog.logException(e);
System.exit(0);
}
}
@@ -156,7 +156,7 @@ public class dbtest {
if (getTable_reference() != null) getTable_reference().delete(entry.getKey());
} catch (final IOException e) {
System.err.println(e);
- Log.logException(e);
+ ConcurrentLog.logException(e);
System.exit(0);
}
}
@@ -195,7 +195,7 @@ public class dbtest {
}
} catch (final IOException e) {
System.err.println(e);
- Log.logException(e);
+ ConcurrentLog.logException(e);
System.exit(0);
}
}
@@ -431,7 +431,7 @@ public class dbtest {
", total=" + (afterclose - startup));
profiler.terminate();
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -470,7 +470,7 @@ final class memprofiler extends Thread {
try {Thread.sleep(100);} catch (final InterruptedException e) {}
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
ImageIO.setUseCache(false);
try {
@@ -478,7 +478,7 @@ final class memprofiler extends Thread {
} catch (final IOException e) {
// do noting
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/AbstractParser.java b/source/net/yacy/document/AbstractParser.java
index 24df186b6..11cc0b131 100644
--- a/source/net/yacy/document/AbstractParser.java
+++ b/source/net/yacy/document/AbstractParser.java
@@ -28,11 +28,11 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public abstract class AbstractParser implements Parser {
- public final static Log log = new Log("PARSER");
+ public final static ConcurrentLog log = new ConcurrentLog("PARSER");
protected final Set<String> SUPPORTED_MIME_TYPES = new HashSet<String>();
protected final Set<String> SUPPORTED_EXTENSIONS = new HashSet<String>();
private final String name;
diff --git a/source/net/yacy/document/Condenser.java b/source/net/yacy/document/Condenser.java
index 30ecfa8fb..c8b74914f 100644
--- a/source/net/yacy/document/Condenser.java
+++ b/source/net/yacy/document/Condenser.java
@@ -47,12 +47,12 @@ import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.federate.solr.Ranking;
import net.yacy.cora.language.synonyms.SynonymLibrary;
import net.yacy.cora.lod.vocabulary.Tagging;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.language.Identificator;
import net.yacy.document.parser.html.ImageEntry;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReferenceRow;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.SetTools;
@@ -479,9 +479,9 @@ public final class Condenser {
sb.append("}\n");
System.out.println(sb.toString());
} catch (final FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/Document.java b/source/net/yacy/document/Document.java
index 9e630f5d3..1b626007d 100644
--- a/source/net/yacy/document/Document.java
+++ b/source/net/yacy/document/Document.java
@@ -57,11 +57,11 @@ import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.lod.vocabulary.Tagging;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Request;
import net.yacy.document.parser.html.ContentScraper;
import net.yacy.document.parser.html.ImageEntry;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.FileUtils;
@@ -342,7 +342,7 @@ dc_rights
assert false : this.text.getClass().toString();
return null;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return new ByteArrayInputStream(UTF8.getBytes(""));
}
@@ -363,7 +363,7 @@ dc_rights
assert this.text instanceof String : this.text.getClass().toString();
return (String) this.text;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return "";
}
@@ -385,7 +385,7 @@ dc_rights
assert false : this.text.getClass().toString();
return -1;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return -1;
}
@@ -819,7 +819,7 @@ dc_rights
try {
docTextLength += FileUtils.copy(doc.getTextStream(), content);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
anchors.putAll(doc.getAnchors());
diff --git a/source/net/yacy/document/LibraryProvider.java b/source/net/yacy/document/LibraryProvider.java
index c7771a973..a51ad8707 100644
--- a/source/net/yacy/document/LibraryProvider.java
+++ b/source/net/yacy/document/LibraryProvider.java
@@ -53,8 +53,8 @@ import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.lod.vocabulary.Tagging.SOTuple;
import net.yacy.cora.storage.Files;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.URLRewriterLibrary;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import com.hp.hpl.jena.rdf.model.Resource;
@@ -220,7 +220,7 @@ public class LibraryProvider {
try {
writeWords(derewoOutput, derewo);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -244,14 +244,14 @@ public class LibraryProvider {
try {
JenaTripleStore.LoadNTriples(Files.read(dictInput));
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
// read the triplestore and generate a vocabulary
Map<String, SOTuple> map = new HashMap<String, SOTuple>();
- Log.logInfo("LibraryProvider", "retrieving PND data from triplestore");
+ ConcurrentLog.info("LibraryProvider", "retrieving PND data from triplestore");
Iterator<Resource> i = JenaTripleStore.getSubjects("http://dbpedia.org/ontology/individualisedPnd");
- Log.logInfo("LibraryProvider", "creating vocabulary map from PND triplestore");
+ ConcurrentLog.info("LibraryProvider", "creating vocabulary map from PND triplestore");
String objectspace = "";
while (i.hasNext()) {
Resource resource = i.next();
@@ -272,10 +272,10 @@ public class LibraryProvider {
map.put(term, new SOTuple(Tagging.normalizeTerm(term), subject));
}
if (!map.isEmpty()) try {
- Log.logInfo("LibraryProvider", "adding vocabulary to autotagging");
+ ConcurrentLog.info("LibraryProvider", "adding vocabulary to autotagging");
Tagging pndVoc = new Tagging("Persons", null, objectspace, map);
autotagging.addVocabulary(pndVoc);
- Log.logInfo("LibraryProvider", "added pnd vocabulary to autotagging");
+ ConcurrentLog.info("LibraryProvider", "added pnd vocabulary to autotagging");
} catch (IOException e) {
}
}
@@ -336,10 +336,10 @@ public class LibraryProvider {
final ZipFile zip = new ZipFile(file);
derewoTxtEntry = zip.getInputStream(zip.getEntry("derewo-v-100000t-2009-04-30-0.1"));
} catch ( final ZipException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return list;
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return list;
}
@@ -379,7 +379,7 @@ public class LibraryProvider {
}
reader.close();
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
if ( reader != null ) {
try {
diff --git a/source/net/yacy/document/SnippetExtractor.java b/source/net/yacy/document/SnippetExtractor.java
index a4f5e7cc7..5be4f8c79 100644
--- a/source/net/yacy/document/SnippetExtractor.java
+++ b/source/net/yacy/document/SnippetExtractor.java
@@ -28,9 +28,9 @@ import java.util.TreeMap;
import java.util.TreeSet;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
public class SnippetExtractor {
@@ -139,7 +139,7 @@ public class SnippetExtractor {
try {
remainingHashes.put(hash);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
p = pos.intValue();
diff --git a/source/net/yacy/document/TextParser.java b/source/net/yacy/document/TextParser.java
index cb965d46e..7e9d35f4d 100644
--- a/source/net/yacy/document/TextParser.java
+++ b/source/net/yacy/document/TextParser.java
@@ -129,13 +129,13 @@ public final class TextParser {
mime2parser.put(mimeType, p0);
}
p0.add(parser);
- AbstractParser.log.logInfo("Parser for mime type '" + mimeType + "': " + parser.getName());
+ AbstractParser.log.info("Parser for mime type '" + mimeType + "': " + parser.getName());
}
if (prototypeMime != null) for (String ext: parser.supportedExtensions()) {
ext = ext.toLowerCase();
final String s = ext2mime.get(ext);
- if (s != null && !s.equals(prototypeMime)) AbstractParser.log.logInfo("Parser for extension '" + ext + "' was set to mime '" + s + "', overwriting with new mime '" + prototypeMime + "'.");
+ if (s != null && !s.equals(prototypeMime)) AbstractParser.log.info("Parser for extension '" + ext + "' was set to mime '" + s + "', overwriting with new mime '" + prototypeMime + "'.");
ext2mime.put(ext, prototypeMime);
}
@@ -148,7 +148,7 @@ public final class TextParser {
ext2parser.put(ext, p0);
}
p0.add(parser);
- AbstractParser.log.logInfo("Parser for extension '" + ext + "': " + parser.getName());
+ AbstractParser.log.info("Parser for extension '" + ext + "': " + parser.getName());
}
}
@@ -162,10 +162,10 @@ public final class TextParser {
BufferedInputStream sourceStream = null;
Document[] docs = null;
try {
- if (AbstractParser.log.isFine()) AbstractParser.log.logFine("Parsing '" + location + "' from file");
+ if (AbstractParser.log.isFine()) AbstractParser.log.fine("Parsing '" + location + "' from file");
if (!sourceFile.exists() || !sourceFile.canRead() || sourceFile.length() == 0) {
final String errorMsg = sourceFile.exists() ? "Empty resource file." : "No resource content available (2).";
- AbstractParser.log.logInfo("Unable to parse '" + location + "'. " + errorMsg);
+ AbstractParser.log.info("Unable to parse '" + location + "'. " + errorMsg);
throw new Parser.Failure(errorMsg, location);
}
sourceStream = new BufferedInputStream(new FileInputStream(sourceFile));
@@ -173,7 +173,7 @@ public final class TextParser {
} catch (final Exception e) {
if (e instanceof InterruptedException) throw (InterruptedException) e;
if (e instanceof Parser.Failure) throw (Parser.Failure) e;
- AbstractParser.log.logSevere("Unexpected exception in parseSource from File: " + e.getMessage(), e);
+ AbstractParser.log.severe("Unexpected exception in parseSource from File: " + e.getMessage(), e);
throw new Parser.Failure("Unexpected exception: " + e.getMessage(), location);
} finally {
if (sourceStream != null) try { sourceStream.close(); } catch (final Exception ex) {}
@@ -188,14 +188,14 @@ public final class TextParser {
final String charset,
final byte[] content
) throws Parser.Failure {
- if (AbstractParser.log.isFine()) AbstractParser.log.logFine("Parsing '" + location + "' from byte-array");
+ if (AbstractParser.log.isFine()) AbstractParser.log.fine("Parsing '" + location + "' from byte-array");
mimeType = normalizeMimeType(mimeType);
Set<Parser> idioms = null;
try {
idioms = parsers(location, mimeType);
} catch (final Parser.Failure e) {
final String errorMsg = "Parser Failure for extension '" + MultiProtocolURI.getFileExtension(location.getFileName()) + "' or mimetype '" + mimeType + "': " + e.getMessage();
- AbstractParser.log.logWarning(errorMsg);
+ AbstractParser.log.warn(errorMsg);
throw new Parser.Failure(errorMsg, location);
}
assert !idioms.isEmpty() : "no parsers applied for url " + location.toNormalform(true);
@@ -212,14 +212,14 @@ public final class TextParser {
final long contentLength,
final InputStream sourceStream
) throws Parser.Failure {
- if (AbstractParser.log.isFine()) AbstractParser.log.logFine("Parsing '" + location + "' from stream");
+ if (AbstractParser.log.isFine()) AbstractParser.log.fine("Parsing '" + location + "' from stream");
mimeType = normalizeMimeType(mimeType);
Set<Parser> idioms = null;
try {
idioms = parsers(location, mimeType);
} catch (final Parser.Failure e) {
final String errorMsg = "Parser Failure for extension '" + MultiProtocolURI.getFileExtension(location.getFileName()) + "' or mimetype '" + mimeType + "': " + e.getMessage();
- AbstractParser.log.logWarning(errorMsg);
+ AbstractParser.log.warn(errorMsg);
throw new Parser.Failure(errorMsg, location);
}
assert !idioms.isEmpty() : "no parsers applied for url " + location.toNormalform(true);
@@ -251,12 +251,12 @@ public final class TextParser {
final String charset,
final InputStream sourceStream
) throws Parser.Failure {
- if (AbstractParser.log.isFine()) AbstractParser.log.logFine("Parsing '" + location + "' from stream");
+ if (AbstractParser.log.isFine()) AbstractParser.log.fine("Parsing '" + location + "' from stream");
final String fileExt = MultiProtocolURI.getFileExtension(location.getFileName());
final String documentCharset = htmlParser.patchCharsetEncoding(charset);
assert parser != null;
- if (AbstractParser.log.isFine()) AbstractParser.log.logFine("Parsing " + location + " with mimeType '" + mimeType + "' and file extension '" + fileExt + "'.");
+ if (AbstractParser.log.isFine()) AbstractParser.log.fine("Parsing " + location + " with mimeType '" + mimeType + "' and file extension '" + fileExt + "'.");
try {
final Document[] docs = parser.parse(location, mimeType, documentCharset, sourceStream);
return docs;
@@ -273,7 +273,7 @@ public final class TextParser {
final byte[] sourceArray
) throws Parser.Failure {
final String fileExt = MultiProtocolURI.getFileExtension(location.getFileName());
- if (AbstractParser.log.isFine()) AbstractParser.log.logFine("Parsing " + location + " with mimeType '" + mimeType + "' and file extension '" + fileExt + "' from byte[]");
+ if (AbstractParser.log.isFine()) AbstractParser.log.fine("Parsing " + location + " with mimeType '" + mimeType + "' and file extension '" + fileExt + "' from byte[]");
final String documentCharset = htmlParser.patchCharsetEncoding(charset);
assert !parsers.isEmpty();
@@ -318,7 +318,7 @@ public final class TextParser {
}
String failedParsers = "";
for (final Map.Entry<Parser, Parser.Failure> error: failedParser.entrySet()) {
- AbstractParser.log.logWarning("tried parser '" + error.getKey().getName() + "' to parse " + location.toNormalform(true) + " but failed: " + error.getValue().getMessage(), error.getValue());
+ AbstractParser.log.warn("tried parser '" + error.getKey().getName() + "' to parse " + location.toNormalform(true) + " but failed: " + error.getValue().getMessage(), error.getValue());
failedParsers += error.getKey().getName() + " ";
}
throw new Parser.Failure("All parser failed: " + failedParsers, location);
diff --git a/source/net/yacy/document/content/DCEntry.java b/source/net/yacy/document/content/DCEntry.java
index f35e2c6a7..5efdbb08b 100644
--- a/source/net/yacy/document/content/DCEntry.java
+++ b/source/net/yacy/document/content/DCEntry.java
@@ -38,9 +38,9 @@ import java.util.Locale;
import java.util.TreeMap;
import net.yacy.cora.date.ISO8601Formatter;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.Document;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
public class DCEntry extends TreeMap<String, String> {
@@ -106,7 +106,7 @@ public class DCEntry extends TreeMap<String, String> {
Date now = new Date();
return x.after(now) ? now : x;
} catch (ParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return new Date();
}
}
@@ -126,9 +126,9 @@ public class DCEntry extends TreeMap<String, String> {
if (useRelationAsAlternative) {
DigestURI relation = this.getRelation();
if (relation != null) return relation;
- Log.logWarning("DCEntry", "getIdentifier: url is bad, relation also: " + e.getMessage());
+ ConcurrentLog.warn("DCEntry", "getIdentifier: url is bad, relation also: " + e.getMessage());
}
- Log.logWarning("DCEntry", "getIdentifier: url is bad: " + e.getMessage());
+ ConcurrentLog.warn("DCEntry", "getIdentifier: url is bad: " + e.getMessage());
return null;
}
}
@@ -144,7 +144,7 @@ public class DCEntry extends TreeMap<String, String> {
try {
return new DigestURI(u);
} catch (MalformedURLException e) {
- Log.logWarning("DCEntry", "getRelation: url is bad: " + e.getMessage());
+ ConcurrentLog.warn("DCEntry", "getRelation: url is bad: " + e.getMessage());
return null;
}
}
diff --git a/source/net/yacy/document/content/SurrogateReader.java b/source/net/yacy/document/content/SurrogateReader.java
index 81f8e79c7..8f7ed72d5 100644
--- a/source/net/yacy/document/content/SurrogateReader.java
+++ b/source/net/yacy/document/content/SurrogateReader.java
@@ -41,7 +41,7 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
@@ -102,7 +102,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
try {
this.saxParser = getParser();
} catch (SAXException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new IOException(e.getMessage());
}
}
@@ -111,21 +111,21 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
try {
this.saxParser.parse(this.inputSource, this);
} catch (SAXParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SAXException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {
this.surrogates.put(DCEntry.poison);
} catch (InterruptedException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
try {
this.inputStream.close();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -155,7 +155,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
try {
this.surrogates.put(this.surrogate);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
//System.out.println("B Title: " + this.surrogate.title());
this.surrogate = null;
@@ -199,7 +199,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
try {
return this.surrogates.take();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -225,7 +225,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
System.out.println("Body: " + s.getDescription());
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/document/content/dao/DatabaseConnection.java b/source/net/yacy/document/content/dao/DatabaseConnection.java
index dddb392f6..9360eab2a 100644
--- a/source/net/yacy/document/content/dao/DatabaseConnection.java
+++ b/source/net/yacy/document/content/dao/DatabaseConnection.java
@@ -30,7 +30,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class DatabaseConnection {
@@ -63,7 +63,7 @@ public class DatabaseConnection {
try {
this.connection.setAutoCommit(b);
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/content/dao/ImportDump.java b/source/net/yacy/document/content/dao/ImportDump.java
index bf8511c94..dc9e59524 100644
--- a/source/net/yacy/document/content/dao/ImportDump.java
+++ b/source/net/yacy/document/content/dao/ImportDump.java
@@ -31,7 +31,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import net.yacy.cora.document.UTF8;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
@@ -83,10 +83,10 @@ public class ImportDump {
}
statement.executeBatch();
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw e;
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new SQLException(e.getMessage());
} finally {
if (statement != null) try {statement.close();} catch (SQLException e) {}
diff --git a/source/net/yacy/document/content/dao/PhpBB3Dao.java b/source/net/yacy/document/content/dao/PhpBB3Dao.java
index 41e3a22db..a8ea4e1fe 100644
--- a/source/net/yacy/document/content/dao/PhpBB3Dao.java
+++ b/source/net/yacy/document/content/dao/PhpBB3Dao.java
@@ -39,10 +39,10 @@ import java.util.HashMap;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.content.DCEntry;
import net.yacy.document.content.SurrogateReader;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
public class PhpBB3Dao implements Dao {
@@ -83,7 +83,7 @@ public class PhpBB3Dao implements Dao {
}
return null;
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} finally {
if (rs != null) try {rs.close();} catch (SQLException e) {}
@@ -103,7 +103,7 @@ public class PhpBB3Dao implements Dao {
}
return null;
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} finally {
if (rs != null) try {rs.close();} catch (SQLException e) {}
@@ -160,12 +160,12 @@ public class PhpBB3Dao implements Dao {
try {
return parseResultSet(rs);
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return null;
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} finally {
if (rs != null) try {rs.close();} catch (SQLException e) {}
@@ -189,14 +189,14 @@ public class PhpBB3Dao implements Dao {
try {
queue.put(parseResultSet(rs));
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
queue.put(DCEntry.poison);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
if (rs != null) try {rs.close();} catch (SQLException e) {}
if (stmt != null) try {stmt.close();} catch (SQLException e) {}
@@ -254,7 +254,7 @@ public class PhpBB3Dao implements Dao {
this.users.put(poster_id, nick);
return nick;
} catch (SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return "";
} finally {
if (rs != null) try {rs.close();} catch (SQLException e) {}
@@ -304,13 +304,13 @@ public class PhpBB3Dao implements Dao {
outputfiletmp.renameTo(outputfile);
return fc + 1;
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (UnsupportedEncodingException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return 0;
}
@@ -339,7 +339,7 @@ public class PhpBB3Dao implements Dao {
File targetdir = new File("x").getParentFile();
db.writeSurrogates(db.query(0, -1, 100), targetdir, "id0-current", 3000);
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/importer/MediawikiImporter.java b/source/net/yacy/document/importer/MediawikiImporter.java
index 4086a464b..050867949 100644
--- a/source/net/yacy/document/importer/MediawikiImporter.java
+++ b/source/net/yacy/document/importer/MediawikiImporter.java
@@ -51,6 +51,7 @@ import java.util.concurrent.TimeoutException;
import java.util.zip.GZIPInputStream;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
import net.yacy.data.wiki.WikiCode;
import net.yacy.data.wiki.WikiParser;
@@ -59,7 +60,6 @@ import net.yacy.document.Parser;
import net.yacy.document.TextParser;
import net.yacy.document.content.SurrogateReader;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteBuffer;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
@@ -209,9 +209,9 @@ public class MediawikiImporter extends Thread implements Importer {
final int u = t.indexOf(textend, q + 1);
if (u > q) {
sb.append(t.substring(q + 1, u));
- Log.logInfo("WIKITRANSLATION", "[INJECT] Title: " + title);
+ ConcurrentLog.info("WIKITRANSLATION", "[INJECT] Title: " + title);
if (sb.length() == 0) {
- Log.logInfo("WIKITRANSLATION", "ERROR: " + title + " has empty content");
+ ConcurrentLog.info("WIKITRANSLATION", "ERROR: " + title + " has empty content");
continue;
}
record = newRecord(this.hostport, this.urlStub, title, sb);
@@ -219,7 +219,7 @@ public class MediawikiImporter extends Thread implements Importer {
in.put(record);
this.count++;
} catch (final InterruptedException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
sb = new StringBuilder(200);
continue;
@@ -230,9 +230,9 @@ public class MediawikiImporter extends Thread implements Importer {
}
if (t.indexOf(textend) >= 0) {
text = false;
- Log.logInfo("WIKITRANSLATION", "[INJECT] Title: " + title);
+ ConcurrentLog.info("WIKITRANSLATION", "[INJECT] Title: " + title);
if (sb.length() == 0) {
- Log.logInfo("WIKITRANSLATION", "ERROR: " + title + " has empty content");
+ ConcurrentLog.info("WIKITRANSLATION", "ERROR: " + title + " has empty content");
continue;
}
record = newRecord(this.hostport, this.urlStub, title, sb);
@@ -240,7 +240,7 @@ public class MediawikiImporter extends Thread implements Importer {
in.put(record);
this.count++;
} catch (final InterruptedException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
sb = new StringBuilder(200);
continue;
@@ -272,18 +272,18 @@ public class MediawikiImporter extends Thread implements Importer {
out.put(poison);
writerResult.get(10000, TimeUnit.MILLISECONDS);
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final ExecutionException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final TimeoutException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -306,7 +306,7 @@ public class MediawikiImporter extends Thread implements Importer {
createIndex(this.mediawikixml);
} catch (final IOException e) {
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -347,10 +347,10 @@ public class MediawikiImporter extends Thread implements Importer {
if (!consumerResult.isDone()) consumerResult.get();
producerResult.get();
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return;
} catch (final ExecutionException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return;
}
in.close();
@@ -375,7 +375,7 @@ public class MediawikiImporter extends Thread implements Importer {
try {
this.entries.put(b);
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -386,17 +386,17 @@ public class MediawikiImporter extends Thread implements Importer {
while(true) {
r = this.entries.take();
if (r == poison) {
- Log.logInfo("WIKITRANSLATION", "producer / got poison");
+ ConcurrentLog.info("WIKITRANSLATION", "producer / got poison");
break;
}
this.out.println(" <page start=\"" + r.start + "\" length=\"" + (r.end - r.start) + "\">");
this.out.println(" <title>" + r.title + "</title>");
this.out.println(" </page>");
- Log.logInfo("WIKITRANSLATION", "producer / record start: " + r.start + ", title : " + r.title);
+ ConcurrentLog.info("WIKITRANSLATION", "producer / record start: " + r.start + ", title : " + r.title);
this.count++;
}
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.entries.clear();
this.out.println("</index>");
@@ -423,7 +423,7 @@ public class MediawikiImporter extends Thread implements Importer {
try {
this.entries.put(b);
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -435,18 +435,18 @@ public class MediawikiImporter extends Thread implements Importer {
while(true) {
c = this.entries.take();
if (c == poison) {
- Log.logInfo("WIKITRANSLATION", "consumer / got poison");
+ ConcurrentLog.info("WIKITRANSLATION", "consumer / got poison");
break;
}
try {
r = new wikisourcerecord(c.b, c.start, c.end);
this.producer.consume(r);
- Log.logInfo("WIKITRANSLATION", "consumer / record start: " + r.start + ", title : " + r.title);
+ ConcurrentLog.info("WIKITRANSLATION", "consumer / record start: " + r.start + ", title : " + r.title);
this.count++;
} catch (final RuntimeException e) {}
}
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.entries.clear();
return Integer.valueOf(this.count);
@@ -514,7 +514,7 @@ public class MediawikiImporter extends Thread implements Importer {
final WikiParser wparser = new WikiCode();
this.html = wparser.transform(this.hostport, this.source);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new IOException(e.getMessage());
}
}
@@ -526,7 +526,7 @@ public class MediawikiImporter extends Thread implements Importer {
// the wiki parser is not able to find the proper title in the source text, so it must be set here
this.document.setTitle(this.title);
} catch (final MalformedURLException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
public void writeXML(final OutputStreamWriter os) throws IOException {
@@ -574,7 +574,7 @@ public class MediawikiImporter extends Thread implements Importer {
try {
this.is.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -587,7 +587,7 @@ public class MediawikiImporter extends Thread implements Importer {
raf.seek(start);
raf.read(b);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} finally {
if (raf != null) try {
@@ -649,7 +649,7 @@ public class MediawikiImporter extends Thread implements Importer {
while(true) {
record = this.in.take();
if (record == this.poison) {
- Log.logInfo("WIKITRANSLATION", "convertConsumer / got poison");
+ ConcurrentLog.info("WIKITRANSLATION", "convertConsumer / got poison");
break;
}
try {
@@ -657,18 +657,18 @@ public class MediawikiImporter extends Thread implements Importer {
record.genDocument();
this.out.put(record);
} catch (final RuntimeException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Parser.Failure e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- Log.logInfo("WIKITRANSLATION", "*** convertConsumer has terminated");
+ ConcurrentLog.info("WIKITRANSLATION", "*** convertConsumer has terminated");
return Integer.valueOf(0);
}
@@ -706,7 +706,7 @@ public class MediawikiImporter extends Thread implements Importer {
while(true) {
record = this.in.take();
if (record == this.poison) {
- Log.logInfo("WIKITRANSLATION", "convertConsumer / got poison");
+ ConcurrentLog.info("WIKITRANSLATION", "convertConsumer / got poison");
break;
}
@@ -716,7 +716,7 @@ public class MediawikiImporter extends Thread implements Importer {
this.osw = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(new File(this.targetdir, this.outputfilename))), "UTF-8");
this.osw.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + SurrogateReader.SURROGATES_MAIN_ELEMENT_OPEN + "\n");
}
- Log.logInfo("WIKITRANSLATION", "[CONSUME] Title: " + record.title);
+ ConcurrentLog.info("WIKITRANSLATION", "[CONSUME] Title: " + record.title);
record.document.writeXML(this.osw, new Date());
this.rc++;
if (this.rc >= 10000) {
@@ -732,13 +732,13 @@ public class MediawikiImporter extends Thread implements Importer {
}
}
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final UnsupportedEncodingException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {
this.osw.write(SurrogateReader.SURROGATES_MAIN_ELEMENT_CLOSE + "\n");
@@ -746,10 +746,10 @@ public class MediawikiImporter extends Thread implements Importer {
final String finalfilename = this.targetstub + "." + this.fc + ".xml";
new File(this.targetdir, this.outputfilename).renameTo(new File(this.targetdir, finalfilename));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
- Log.logInfo("WIKITRANSLATION", "*** convertWriter has terminated");
+ ConcurrentLog.info("WIKITRANSLATION", "*** convertWriter has terminated");
return Integer.valueOf(0);
}
@@ -757,11 +757,11 @@ public class MediawikiImporter extends Thread implements Importer {
public static void main(final String[] s) {
if (s.length == 0) {
- Log.logInfo("WIKITRANSLATION", "usage:");
- Log.logInfo("WIKITRANSLATION", " -index <wikipedia-dump>");
- Log.logInfo("WIKITRANSLATION", " -read <start> <len> <idx-file>");
- Log.logInfo("WIKITRANSLATION", " -find <title> <wikipedia-dump>");
- Log.logInfo("WIKITRANSLATION", " -convert <wikipedia-dump-xml.bz2> <convert-target-dir> <url-stub>");
+ ConcurrentLog.info("WIKITRANSLATION", "usage:");
+ ConcurrentLog.info("WIKITRANSLATION", " -index <wikipedia-dump>");
+ ConcurrentLog.info("WIKITRANSLATION", " -read <start> <len> <idx-file>");
+ ConcurrentLog.info("WIKITRANSLATION", " -find <title> <wikipedia-dump>");
+ ConcurrentLog.info("WIKITRANSLATION", " -convert <wikipedia-dump-xml.bz2> <convert-target-dir> <url-stub>");
System.exit(0);
}
@@ -778,7 +778,7 @@ public class MediawikiImporter extends Thread implements Importer {
mi.start();
mi.join();
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -786,7 +786,7 @@ public class MediawikiImporter extends Thread implements Importer {
try {
createIndex(new File(s[1]));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -800,12 +800,12 @@ public class MediawikiImporter extends Thread implements Importer {
try {
final wikisourcerecord w = find(s[1], new File(s[2] + ".idx.xml"));
if (w == null) {
- Log.logInfo("WIKITRANSLATION", "not found");
+ ConcurrentLog.info("WIKITRANSLATION", "not found");
} else {
System.out.println(UTF8.String(read(new File(s[2]), w.start, (int) (w.end - w.start))));
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/importer/OAIListFriendsLoader.java b/source/net/yacy/document/importer/OAIListFriendsLoader.java
index 8f432c206..b38f8e2f9 100644
--- a/source/net/yacy/document/importer/OAIListFriendsLoader.java
+++ b/source/net/yacy/document/importer/OAIListFriendsLoader.java
@@ -42,9 +42,9 @@ import javax.xml.parsers.SAXParserFactory;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Response;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.LoaderDispatcher;
import net.yacy.search.snippet.TextSnippet;
@@ -76,7 +76,7 @@ public class OAIListFriendsLoader implements Serializable {
try {
p.loadFromXML(new FileInputStream(initFile));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return m;
}
for (final Entry<Object, Object> e: p.entrySet()) m.put((String) e.getKey(), new File(dataPath, (String) e.getValue()));
@@ -142,16 +142,16 @@ public class OAIListFriendsLoader implements Serializable {
this.saxParser = getParser();
this.saxParser.parse(this.stream, this);
} catch (final SAXException e) {
- Log.logException(e);
- Log.logWarning("OAIListFriendsLoader.Parser", "OAIListFriends was not parsed:\n" + UTF8.String(b));
+ ConcurrentLog.logException(e);
+ ConcurrentLog.warn("OAIListFriendsLoader.Parser", "OAIListFriends was not parsed:\n" + UTF8.String(b));
} catch (final IOException e) {
- Log.logException(e);
- Log.logWarning("OAIListFriendsLoader.Parser", "OAIListFriends was not parsed:\n" + UTF8.String(b));
+ ConcurrentLog.logException(e);
+ ConcurrentLog.warn("OAIListFriendsLoader.Parser", "OAIListFriends was not parsed:\n" + UTF8.String(b));
} finally {
try {
this.stream.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/document/importer/OAIPMHImporter.java b/source/net/yacy/document/importer/OAIPMHImporter.java
index 1a852a7e2..695bc0659 100644
--- a/source/net/yacy/document/importer/OAIPMHImporter.java
+++ b/source/net/yacy/document/importer/OAIPMHImporter.java
@@ -33,8 +33,8 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.date.GenericFormatter;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.LoaderDispatcher;
import net.yacy.search.Switchboard;
@@ -77,7 +77,7 @@ public class OAIPMHImporter extends Thread implements Importer, Comparable<OAIPM
this.source = new DigestURI(url + "verb=ListRecords&metadataPrefix=oai_dc");
} catch (MalformedURLException e) {
// this should never happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
startedJobs.put(this, N);
}
@@ -217,7 +217,7 @@ public class OAIPMHImporter extends Thread implements Importer, Comparable<OAIPM
Date md = map.get(hostID);
if (md == null || fd.after(md)) map.put(hostID, fd);
} catch (ParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/document/importer/OAIPMHLoader.java b/source/net/yacy/document/importer/OAIPMHLoader.java
index ca00a6df0..5c822d055 100644
--- a/source/net/yacy/document/importer/OAIPMHLoader.java
+++ b/source/net/yacy/document/importer/OAIPMHLoader.java
@@ -27,9 +27,9 @@ import java.io.IOException;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Response;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.LoaderDispatcher;
import net.yacy.search.snippet.TextSnippet;
@@ -50,7 +50,7 @@ public class OAIPMHLoader {
this.source = source;
// load the file from the net
- Log.logInfo("OAIPMHLoader", "loading record from " + source.toNormalform(true));
+ ConcurrentLog.info("OAIPMHLoader", "loading record from " + source.toNormalform(true));
Response response = null;
IOException ee = null;
for (int i = 0; i < 5; i++) {
@@ -59,7 +59,7 @@ public class OAIPMHLoader {
response = loader.load(loader.request(source, false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, TextSnippet.snippetMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
break;
} catch (IOException e) {
- Log.logWarning("OAIPMHLoader", "loading failed at attempt " + (i + 1) + ": " + source.toNormalform(true));
+ ConcurrentLog.warn("OAIPMHLoader", "loading failed at attempt " + (i + 1) + ": " + source.toNormalform(true));
ee = e;
continue;
}
diff --git a/source/net/yacy/document/importer/ResumptionToken.java b/source/net/yacy/document/importer/ResumptionToken.java
index ba4f0839b..9eff9a12f 100644
--- a/source/net/yacy/document/importer/ResumptionToken.java
+++ b/source/net/yacy/document/importer/ResumptionToken.java
@@ -37,8 +37,8 @@ import javax.xml.parsers.SAXParserFactory;
import net.yacy.cora.date.ISO8601Formatter;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -194,7 +194,7 @@ public class ResumptionToken extends TreeMap<String, String> {
try {
return ISO8601Formatter.FORMATTER.parse(d);
} catch (final ParseException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return new Date();
}
}
@@ -279,17 +279,17 @@ public class ResumptionToken extends TreeMap<String, String> {
this.saxParser = getParser();
this.saxParser.parse(this.stream, this);
} catch (final SAXException e) {
- Log.logException(e);
- Log.logWarning("ResumptionToken", "token was not parsed (1):\n" + UTF8.String(b));
+ ConcurrentLog.logException(e);
+ ConcurrentLog.warn("ResumptionToken", "token was not parsed (1):\n" + UTF8.String(b));
} catch (final IOException e) {
- Log.logException(e);
- Log.logWarning("ResumptionToken", "token was not parsed (2):\n" + UTF8.String(b));
+ ConcurrentLog.logException(e);
+ ConcurrentLog.warn("ResumptionToken", "token was not parsed (2):\n" + UTF8.String(b));
throw new IOException(e.getMessage());
} finally {
try {
this.stream.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/document/language/LanguageStatistics.java b/source/net/yacy/document/language/LanguageStatistics.java
index 70115d87e..fe97bcbf5 100644
--- a/source/net/yacy/document/language/LanguageStatistics.java
+++ b/source/net/yacy/document/language/LanguageStatistics.java
@@ -33,7 +33,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
/**
@@ -41,7 +41,7 @@ import net.yacy.kelondro.logging.Log;
*/
public class LanguageStatistics {
- private static Log logger = new Log("LANGUAGESTATISTICS");
+ private static ConcurrentLog logger = new ConcurrentLog("LANGUAGESTATISTICS");
/** This variable holds the name of the language. */
private String langName = null;
@@ -133,15 +133,15 @@ public class LanguageStatistics {
} catch (final FileNotFoundException ex) {
ret = false;
- logger.logWarning("ERROR: file '" + file.getName() + "' not found", ex);
+ logger.warn("ERROR: file '" + file.getName() + "' not found", ex);
} catch (final IOException ex) {
- logger.logWarning("ERROR: problems reading file '" + file.getName() + "'", ex);
+ logger.warn("ERROR: problems reading file '" + file.getName() + "'", ex);
} finally {
try { if(reader != null) {
reader.close();
}
} catch (final IOException ex) {
- logger.logWarning("ERROR: IO trouble ", ex);
+ logger.warn("ERROR: IO trouble ", ex);
}
}
return ret;
diff --git a/source/net/yacy/document/language/LanguageStatisticsHolder.java b/source/net/yacy/document/language/LanguageStatisticsHolder.java
index 1c384aed4..e6d06a013 100644
--- a/source/net/yacy/document/language/LanguageStatisticsHolder.java
+++ b/source/net/yacy/document/language/LanguageStatisticsHolder.java
@@ -28,7 +28,7 @@ import java.io.File;
import java.io.FilenameFilter;
import java.util.Vector;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
/**
@@ -68,7 +68,7 @@ public final class LanguageStatisticsHolder extends Vector<LanguageStatistics> {
final File folder = new File(directory);
if (!folder.exists()) {
- Log.logWarning("LanguageStatistics", "the language statistics folder " + directory + " cannot be found");
+ ConcurrentLog.warn("LanguageStatistics", "the language statistics folder " + directory + " cannot be found");
return;
}
final FilenameFilter filter = new LanguageFilenameFilter();
diff --git a/source/net/yacy/document/parser/audioTagParser.java b/source/net/yacy/document/parser/audioTagParser.java
index aef05c58d..3727144bc 100644
--- a/source/net/yacy/document/parser/audioTagParser.java
+++ b/source/net/yacy/document/parser/audioTagParser.java
@@ -35,11 +35,11 @@ import java.util.List;
import java.util.Set;
import net.yacy.cora.document.MultiProtocolURI;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import org.jaudiotagger.audio.AudioFile;
import org.jaudiotagger.audio.AudioFileIO;
@@ -209,7 +209,7 @@ public class audioTagParser extends AbstractParser implements Parser {
fout.close();
} catch (IOException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (tempFile != null)
tempFile.delete();
diff --git a/source/net/yacy/document/parser/augment/AugmentParser.java b/source/net/yacy/document/parser/augment/AugmentParser.java
index 3b1a26cf6..19a244335 100644
--- a/source/net/yacy/document/parser/augment/AugmentParser.java
+++ b/source/net/yacy/document/parser/augment/AugmentParser.java
@@ -6,13 +6,13 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.ymark.YMarkUtil;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.document.parser.rdfa.impl.RDFaParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
@@ -24,7 +24,7 @@ public class AugmentParser extends AbstractParser implements Parser {
super("AugmentParser");
this.rdfaParser = new RDFaParser();
- Log.logInfo("AugmentedParser", "augmented parser was initialized");
+ ConcurrentLog.info("AugmentedParser", "augmented parser was initialized");
this.SUPPORTED_EXTENSIONS.add("html");
this.SUPPORTED_EXTENSIONS.add("php");
@@ -41,7 +41,7 @@ public class AugmentParser extends AbstractParser implements Parser {
try {
source.reset();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
for (final Document doc : htmlDocs) {
@@ -81,7 +81,7 @@ public class AugmentParser extends AbstractParser implements Parser {
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/parser/html/ContentScraper.java b/source/net/yacy/document/parser/html/ContentScraper.java
index 1d10b350e..7a734087f 100644
--- a/source/net/yacy/document/parser/html/ContentScraper.java
+++ b/source/net/yacy/document/parser/html/ContentScraper.java
@@ -49,13 +49,13 @@ import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.storage.SizeLimitedMap;
import net.yacy.cora.storage.SizeLimitedSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
import net.yacy.document.SentenceReader;
import net.yacy.document.parser.htmlParser;
import net.yacy.document.parser.html.Evaluation.Element;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.CharBuffer;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.ISO639;
@@ -554,7 +554,7 @@ public class ContentScraper extends AbstractScraper implements Scraper {
try {
FileUtils.copy(new CharArrayReader(inlineHtml), writer);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return cleanLine(CharacterCoding.html2unicode(stripAllTags(inlineHtml)));
} finally {
try {
@@ -679,7 +679,7 @@ public class ContentScraper extends AbstractScraper implements Scraper {
try {
return this.content.toString();
} catch (final OutOfMemoryError e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return "";
}
}
diff --git a/source/net/yacy/document/parser/html/Evaluation.java b/source/net/yacy/document/parser/html/Evaluation.java
index 56fd29e9e..f54fd9bf0 100644
--- a/source/net/yacy/document/parser/html/Evaluation.java
+++ b/source/net/yacy/document/parser/html/Evaluation.java
@@ -37,7 +37,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import net.yacy.cora.sorting.ClusteredScoreMap;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
@@ -118,7 +118,7 @@ public class Evaluation {
final String v = (String) entry.getValue();
final int w = k.indexOf('_');
if (w < 0) {
- Log.logSevere("PatternAnalysis", "wrong configuration in " + name + ": separator '_' missing: " + k);
+ ConcurrentLog.severe("PatternAnalysis", "wrong configuration in " + name + ": separator '_' missing: " + k);
continue;
}
subject = k.substring(0, w);
@@ -126,12 +126,12 @@ public class Evaluation {
try {
pattern = Pattern.compile(v);
} catch (final PatternSyntaxException e) {
- Log.logSevere("PatternAnalysis", "bad pattern in " + name + ": '" + k + "=" + v + "' - " + e.getDescription());
+ ConcurrentLog.severe("PatternAnalysis", "bad pattern in " + name + ": '" + k + "=" + v + "' - " + e.getDescription());
continue;
}
element = Element.valueOf(elementName);
if (element == null) {
- Log.logSevere("PatternAnalysis", "unknown element in " + name + ": " + elementName);
+ ConcurrentLog.severe("PatternAnalysis", "unknown element in " + name + ": " + elementName);
continue;
}
List<Attribute> attributeList = this.elementMatcher.get(element);
diff --git a/source/net/yacy/document/parser/html/TransformerWriter.java b/source/net/yacy/document/parser/html/TransformerWriter.java
index 16f349c16..175ac1934 100644
--- a/source/net/yacy/document/parser/html/TransformerWriter.java
+++ b/source/net/yacy/document/parser/html/TransformerWriter.java
@@ -45,9 +45,9 @@ import java.util.Enumeration;
import java.util.Properties;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.CharBuffer;
-import net.yacy.kelondro.logging.Log;
public final class TransformerWriter extends Writer {
@@ -557,9 +557,9 @@ public final class TransformerWriter extends Writer {
is.close();
scraper.print();
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/parser/images/bmpParser.java b/source/net/yacy/document/parser/images/bmpParser.java
index 3782df405..a4499e395 100644
--- a/source/net/yacy/document/parser/images/bmpParser.java
+++ b/source/net/yacy/document/parser/images/bmpParser.java
@@ -32,7 +32,7 @@ import java.io.IOException;
import javax.imageio.ImageIO;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class bmpParser {
@@ -256,15 +256,15 @@ public class bmpParser {
fis = new FileInputStream(in);
fis.read(file);
} catch (final FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try {
ImageIO.write(parse(file).getImage(), "PNG", out);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
\ No newline at end of file
diff --git a/source/net/yacy/document/parser/images/genericImageParser.java b/source/net/yacy/document/parser/images/genericImageParser.java
index bca31f21c..05473f5c5 100644
--- a/source/net/yacy/document/parser/images/genericImageParser.java
+++ b/source/net/yacy/document/parser/images/genericImageParser.java
@@ -43,13 +43,13 @@ import java.util.Set;
import javax.imageio.ImageIO;
import net.yacy.cora.document.MultiProtocolURI;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.document.parser.html.ImageEntry;
import net.yacy.document.parser.images.bmpParser.IMAGEMAP;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import com.drew.imaging.jpeg.JpegProcessingException;
@@ -110,7 +110,7 @@ public class genericImageParser extends AbstractParser implements Parser {
try {
b = FileUtils.read(sourceStream);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new Parser.Failure(e.getMessage(), location);
}
final IMAGEMAP imap = bmpParser.parse(b);
@@ -124,7 +124,7 @@ public class genericImageParser extends AbstractParser implements Parser {
try {
b = FileUtils.read(sourceStream);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new Parser.Failure(e.getMessage(), location);
}
diff --git a/source/net/yacy/document/parser/images/icoParser.java b/source/net/yacy/document/parser/images/icoParser.java
index 3d2d485d8..4ff965387 100644
--- a/source/net/yacy/document/parser/images/icoParser.java
+++ b/source/net/yacy/document/parser/images/icoParser.java
@@ -32,7 +32,7 @@ import java.io.IOException;
import javax.imageio.ImageIO;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class icoParser {
@@ -107,9 +107,9 @@ public class icoParser {
fis = new FileInputStream(in);
fis.read(file);
} catch (final FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
final icoParser parser = new icoParser(file);
@@ -117,7 +117,7 @@ public class icoParser {
try {
ImageIO.write(parser.getImage(0), "PNG", out);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/document/parser/mmParser.java b/source/net/yacy/document/parser/mmParser.java
index b40b78f0a..482c15a07 100644
--- a/source/net/yacy/document/parser/mmParser.java
+++ b/source/net/yacy/document/parser/mmParser.java
@@ -94,9 +94,9 @@ public class mmParser extends AbstractParser implements Parser {
content = UTF8.getBytes(sb.toString());
} catch (SAXException ex) {
- AbstractParser.log.logWarning(ex.getMessage());
+ AbstractParser.log.warn(ex.getMessage());
} catch (IOException ex) {
- AbstractParser.log.logWarning(ex.getMessage());
+ AbstractParser.log.warn(ex.getMessage());
}
return new Document[]{new Document(
diff --git a/source/net/yacy/document/parser/ooxmlParser.java b/source/net/yacy/document/parser/ooxmlParser.java
index 9e579351b..2d727e38e 100644
--- a/source/net/yacy/document/parser/ooxmlParser.java
+++ b/source/net/yacy/document/parser/ooxmlParser.java
@@ -40,6 +40,7 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
@@ -47,7 +48,6 @@ import net.yacy.document.parser.xml.ODContentHandler;
import net.yacy.document.parser.xml.ODMetaHandler;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.CharBuffer;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import org.xml.sax.SAXException;
@@ -189,7 +189,7 @@ public class ooxmlParser extends AbstractParser implements Parser {
writer.close();
} catch (final Exception ex) {/* ignore this */}
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new Parser.Failure("Unexpected error while parsing odt file. " + e.getMessage(),location);
}
}
diff --git a/source/net/yacy/document/parser/pdfParser.java b/source/net/yacy/document/parser/pdfParser.java
index e54b71227..a364f0461 100644
--- a/source/net/yacy/document/parser/pdfParser.java
+++ b/source/net/yacy/document/parser/pdfParser.java
@@ -55,12 +55,12 @@ import org.apache.pdfbox.pdmodel.font.PDType3Font;
import org.apache.pdfbox.util.PDFTextStripper;
import net.yacy.cora.document.MultiProtocolURI;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.CharBuffer;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -261,14 +261,14 @@ public class pdfParser extends AbstractParser implements Parser {
document = Document.mergeDocuments(null, "application/pdf", parser.parse(null, "application/pdf", null, new FileInputStream(pdfFile)));
} catch (final Parser.Failure e) {
System.err.println("Cannot parse file " + pdfFile.getAbsolutePath());
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final InterruptedException e) {
System.err.println("Interrupted while parsing!");
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final NoClassDefFoundError e) {
System.err.println("class not found: " + e.getMessage());
} catch (final FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// statistics
@@ -284,7 +284,7 @@ public class pdfParser extends AbstractParser implements Parser {
FileUtils.copy(document.getTextStream(), new File("parsedPdf.txt"));
} catch (final IOException e) {
System.err.println("error saving parsed document");
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
} else {
diff --git a/source/net/yacy/document/parser/pptParser.java b/source/net/yacy/document/parser/pptParser.java
index 260546fad..c868823fc 100644
--- a/source/net/yacy/document/parser/pptParser.java
+++ b/source/net/yacy/document/parser/pptParser.java
@@ -30,11 +30,11 @@ package net.yacy.document.parser;
import java.io.BufferedInputStream;
import java.io.InputStream;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import org.apache.poi.hslf.extractor.PowerPointExtractor;
@@ -107,9 +107,9 @@ public class pptParser extends AbstractParser implements Parser {
/*
* an unexpected error occurred, log it and throw a Parser.Failure
*/
- Log.logException(e);
+ ConcurrentLog.logException(e);
final String errorMsg = "Unable to parse the ppt document '" + location + "':" + e.getMessage();
- AbstractParser.log.logSevere(errorMsg);
+ AbstractParser.log.severe(errorMsg);
throw new Parser.Failure(errorMsg, location);
}
}
diff --git a/source/net/yacy/document/parser/psParser.java b/source/net/yacy/document/parser/psParser.java
index 8480e6a7e..208853959 100644
--- a/source/net/yacy/document/parser/psParser.java
+++ b/source/net/yacy/document/parser/psParser.java
@@ -77,7 +77,7 @@ public class psParser extends AbstractParser implements Parser {
final int returnCode = ps2asciiProc.waitFor();
return (returnCode == 0);
} catch (final Exception e) {
- if (AbstractParser.log != null) AbstractParser.log.logInfo("ps2ascii not found. Switching to java parser mode.");
+ if (AbstractParser.log != null) AbstractParser.log.info("ps2ascii not found. Switching to java parser mode.");
return false;
}
}
@@ -246,7 +246,7 @@ public class psParser extends AbstractParser implements Parser {
execCode = ps2asciiProc.waitFor();
} catch (final Exception e) {
final String errorMsg = "Unable to convert ps to ascii. " + e.getMessage();
- AbstractParser.log.logSevere(errorMsg);
+ AbstractParser.log.severe(errorMsg);
throw new Exception(errorMsg);
}
diff --git a/source/net/yacy/document/parser/rdfa/impl/RDFaParser.java b/source/net/yacy/document/parser/rdfa/impl/RDFaParser.java
index b3d3cb957..7f8e69788 100644
--- a/source/net/yacy/document/parser/rdfa/impl/RDFaParser.java
+++ b/source/net/yacy/document/parser/rdfa/impl/RDFaParser.java
@@ -15,13 +15,13 @@ import java.net.URL;
import java.util.HashSet;
import java.util.Set;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.document.parser.htmlParser;
import net.yacy.document.parser.rdfa.IRDFaTriple;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
/**
* @author fgandon
@@ -75,7 +75,7 @@ public class RDFaParser extends AbstractParser implements Parser {
allTriples = triple.parse();
} catch (Exception e) {
- Log.logWarning("RDFA PARSER", "Triple extraction failed");
+ ConcurrentLog.warn("RDFA PARSER", "Triple extraction failed");
}
Document doc = new Document(url, mimeType, charset, null, null, null, singleList(""), "",
@@ -87,7 +87,7 @@ public class RDFaParser extends AbstractParser implements Parser {
allTriples);
} catch (Exception e) {
- Log.logWarning("RDFA PARSER",
+ ConcurrentLog.warn("RDFA PARSER",
"Conversion triple to document failed");
}
return doc;
@@ -103,7 +103,7 @@ public class RDFaParser extends AbstractParser implements Parser {
source.reset();
} catch (IOException e1) {
- Log.logWarning("RDFA PARSER", "Super call failed");
+ ConcurrentLog.warn("RDFA PARSER", "Super call failed");
}
return htmlDocs;
}
diff --git a/source/net/yacy/document/parser/rdfa/impl/RDFaTripleImpl.java b/source/net/yacy/document/parser/rdfa/impl/RDFaTripleImpl.java
index b1a125f4b..a0db29086 100644
--- a/source/net/yacy/document/parser/rdfa/impl/RDFaTripleImpl.java
+++ b/source/net/yacy/document/parser/rdfa/impl/RDFaTripleImpl.java
@@ -15,8 +15,8 @@ import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import net.yacy.yacy;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.parser.rdfa.IRDFaTriple;
-import net.yacy.kelondro.logging.Log;
public class RDFaTripleImpl{
@@ -50,7 +50,7 @@ public class RDFaTripleImpl{
TransformerFactory aFactory = TransformerFactory.newInstance();
templates = aFactory.newTemplates(aSource);
} catch(Exception e){
- Log.logSevere("RDFA PARSER", "XSL template could not be loaded from " + f.toString());
+ ConcurrentLog.severe("RDFA PARSER", "XSL template could not be loaded from " + f.toString());
}
}
this.aTransformer = templates.newTransformer();
@@ -64,7 +64,7 @@ public class RDFaTripleImpl{
try {
this.aTransformer.transform(new StreamSource(this.in), new StreamResult(System.out));
} catch (TransformerException e) {
- Log.logWarning("RDFA PARSER", "Error while reading RDFa");
+ ConcurrentLog.warn("RDFA PARSER", "Error while reading RDFa");
// e.printStackTrace();
}
diff --git a/source/net/yacy/document/parser/sevenzipParser.java b/source/net/yacy/document/parser/sevenzipParser.java
index 6e9204fa6..97754e2f6 100644
--- a/source/net/yacy/document/parser/sevenzipParser.java
+++ b/source/net/yacy/document/parser/sevenzipParser.java
@@ -33,12 +33,12 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import SevenZip.ArchiveExtractCallback;
import SevenZip.IInStream;
@@ -74,14 +74,14 @@ public class sevenzipParser extends AbstractParser implements Parser {
null,
false);
Handler archive;
- AbstractParser.log.logFine("opening 7zip archive...");
+ AbstractParser.log.fine("opening 7zip archive...");
try {
archive = new Handler(source);
} catch (final IOException e) {
throw new Parser.Failure("error opening 7zip archive: " + e.getMessage(), location);
}
final SZParserExtractCallback aec = new SZParserExtractCallback(AbstractParser.log, archive, doc, location.getFile());
- AbstractParser.log.logFine("processing archive contents...");
+ AbstractParser.log.fine("processing archive contents...");
try {
archive.Extract(null, -1, 0, aec);
return doc;
@@ -117,12 +117,12 @@ public class sevenzipParser extends AbstractParser implements Parser {
// and parse the extracted content
private static class SZParserExtractCallback extends ArchiveExtractCallback {
- private final Log log;
+ private final ConcurrentLog log;
private ByteArrayOutputStream cfos = null;
private final Document doc;
private final String prefix;
- public SZParserExtractCallback(final Log logger, final IInArchive handler,
+ public SZParserExtractCallback(final ConcurrentLog logger, final IInArchive handler,
final Document doc, final String prefix) {
super.Init(handler);
this.log = logger;
@@ -135,13 +135,13 @@ public class sevenzipParser extends AbstractParser implements Parser {
this.extractMode = (arg0 == IInArchive.NExtract_NAskMode_kExtract);
switch (arg0) {
case IInArchive.NExtract_NAskMode_kExtract:
- this.log.logFine("Extracting " + this.filePath);
+ this.log.fine("Extracting " + this.filePath);
break;
case IInArchive.NExtract_NAskMode_kTest:
- this.log.logFine("Testing " + this.filePath);
+ this.log.fine("Testing " + this.filePath);
break;
case IInArchive.NExtract_NAskMode_kSkip:
- this.log.logFine("Skipping " + this.filePath);
+ this.log.fine("Skipping " + this.filePath);
break;
}
}
diff --git a/source/net/yacy/document/parser/sitemapParser.java b/source/net/yacy/document/parser/sitemapParser.java
index 238fed1f4..c9944fbbf 100644
--- a/source/net/yacy/document/parser/sitemapParser.java
+++ b/source/net/yacy/document/parser/sitemapParser.java
@@ -44,6 +44,7 @@ import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.http.HTTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
@@ -51,7 +52,6 @@ import net.yacy.document.TextParser;
import net.yacy.document.parser.html.ImageEntry;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.ByteCountInputStream;
-import net.yacy.kelondro.logging.Log;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Element;
@@ -109,7 +109,7 @@ public class sitemapParser extends AbstractParser implements Parser {
public static SitemapReader parse(final DigestURI sitemapURL) throws IOException {
// download document
- Log.logInfo("SitemapReader", "loading sitemap from " + sitemapURL.toNormalform(true));
+ ConcurrentLog.info("SitemapReader", "loading sitemap from " + sitemapURL.toNormalform(true));
final RequestHeader requestHeader = new RequestHeader();
final HTTPClient client = new HTTPClient(ClientIdentification.getUserAgent(), 5000);
client.setHeader(requestHeader.entrySet());
@@ -179,7 +179,7 @@ public class sitemapParser extends AbstractParser implements Parser {
}
}
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try {
diff --git a/source/net/yacy/document/parser/tarParser.java b/source/net/yacy/document/parser/tarParser.java
index 8f03b6b85..772c0ef57 100644
--- a/source/net/yacy/document/parser/tarParser.java
+++ b/source/net/yacy/document/parser/tarParser.java
@@ -94,12 +94,12 @@ public class tarParser extends AbstractParser implements Parser {
if (subDocs == null) continue;
for (final Document d: subDocs) docacc.add(d);
} catch (final Parser.Failure e) {
- AbstractParser.log.logWarning("tar parser entry " + name + ": " + e.getMessage());
+ AbstractParser.log.warn("tar parser entry " + name + ": " + e.getMessage());
} finally {
if (tmp != null) FileUtils.deletedelete(tmp);
}
} catch (final IOException e) {
- AbstractParser.log.logWarning("tar parser:" + e.getMessage());
+ AbstractParser.log.warn("tar parser:" + e.getMessage());
break;
}
}
diff --git a/source/net/yacy/document/parser/vcfParser.java b/source/net/yacy/document/parser/vcfParser.java
index 8ffe75658..cd1f44508 100644
--- a/source/net/yacy/document/parser/vcfParser.java
+++ b/source/net/yacy/document/parser/vcfParser.java
@@ -197,7 +197,7 @@ public class vcfParser extends AbstractParser implements Parser {
}
} else {
- if (AbstractParser.log.isFinest()) AbstractParser.log.logFinest("Invalid data in vcf file" +
+ if (AbstractParser.log.isFinest()) AbstractParser.log.finest("Invalid data in vcf file" +
"\n\tURL: " + url +
"\n\tLine: " + line +
"\n\tLine-Nr: " + lineNr);
diff --git a/source/net/yacy/document/parser/vsdParser.java b/source/net/yacy/document/parser/vsdParser.java
index eadf496ae..e3ab51966 100644
--- a/source/net/yacy/document/parser/vsdParser.java
+++ b/source/net/yacy/document/parser/vsdParser.java
@@ -29,11 +29,11 @@ package net.yacy.document.parser;
import java.io.InputStream;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import org.apache.poi.hdgf.extractor.VisioTextExtractor;
import org.apache.poi.hpsf.SummaryInformation;
@@ -76,7 +76,7 @@ public class vsdParser extends AbstractParser implements Parser {
contents = extractor.getText();
summary = extractor.getSummaryInformation();
} catch (Exception e) {
- Log.logWarning("vsdParser", e.getMessage());
+ ConcurrentLog.warn("vsdParser", e.getMessage());
}
String author = null;
@@ -125,13 +125,13 @@ public class vsdParser extends AbstractParser implements Parser {
// if an unexpected error occures just log the error and raise a new ParserException
final String errorMsg = "Unable to parse the vsd document '" + location + "':" + e.getMessage();
- AbstractParser.log.logSevere(errorMsg);
+ AbstractParser.log.severe(errorMsg);
throw new Parser.Failure(errorMsg, location);
} finally {
if (theDoc == null) {
// if an unexpected error occures just log the error and raise a new Parser.Failure
final String errorMsg = "Unable to parse the vsd document '" + location + "': possibly out of memory";
- AbstractParser.log.logSevere(errorMsg);
+ AbstractParser.log.severe(errorMsg);
throw new Parser.Failure(errorMsg, location);
}
}
diff --git a/source/net/yacy/document/parser/xlsParser.java b/source/net/yacy/document/parser/xlsParser.java
index 1ad1d55fe..41c2a4244 100644
--- a/source/net/yacy/document/parser/xlsParser.java
+++ b/source/net/yacy/document/parser/xlsParser.java
@@ -29,11 +29,11 @@ package net.yacy.document.parser;
import java.io.InputStream;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import org.apache.poi.hssf.eventusermodel.HSSFEventFactory;
import org.apache.poi.hssf.eventusermodel.HSSFListener;
@@ -136,7 +136,7 @@ public class xlsParser extends AbstractParser implements Parser {
/*
* an unexpected error occurred, log it and throw a Parser.Failure
*/
- Log.logException(e);
+ ConcurrentLog.logException(e);
final String errorMsg = "Unable to parse the xls document '" + location + "':" + e.getMessage();
throw new Parser.Failure(errorMsg, location);
}
diff --git a/source/net/yacy/document/parser/xml/ODContentHandler.java b/source/net/yacy/document/parser/xml/ODContentHandler.java
index 684de9b55..8be1899ce 100644
--- a/source/net/yacy/document/parser/xml/ODContentHandler.java
+++ b/source/net/yacy/document/parser/xml/ODContentHandler.java
@@ -29,7 +29,7 @@ package net.yacy.document.parser.xml;
import java.io.IOException;
import java.io.Writer;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.xml.sax.helpers.DefaultHandler;
@@ -50,7 +50,7 @@ public class ODContentHandler extends DefaultHandler {
try {
out.write(ch, start, length);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@Override
@@ -60,7 +60,7 @@ public class ODContentHandler extends DefaultHandler {
try {
out.append("\n");
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/document/parser/xml/opensearchdescriptionReader.java b/source/net/yacy/document/parser/xml/opensearchdescriptionReader.java
index a32a4aa14..fc0d91d12 100644
--- a/source/net/yacy/document/parser/xml/opensearchdescriptionReader.java
+++ b/source/net/yacy/document/parser/xml/opensearchdescriptionReader.java
@@ -35,7 +35,8 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.http.HTTPClient;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
+
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -127,7 +128,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
final SAXParser saxParser = getParser();
saxParser.parse(path, this);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -137,7 +138,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
final SAXParser saxParser = getParser();
saxParser.parse(stream, this);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -150,7 +151,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
saxParser.parse(www.getContentstream(), this);
www.finish();
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -177,7 +178,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
www.finish();
return true;
} catch (final Exception e) {
- Log.logWarning("opensearchdescriptionReader", "parse exception: " + e);
+ ConcurrentLog.warn("opensearchdescriptionReader", "parse exception: " + e);
return false;
}
}
diff --git a/source/net/yacy/document/parser/zipParser.java b/source/net/yacy/document/parser/zipParser.java
index dc1346140..48695ae3a 100644
--- a/source/net/yacy/document/parser/zipParser.java
+++ b/source/net/yacy/document/parser/zipParser.java
@@ -92,12 +92,12 @@ public class zipParser extends AbstractParser implements Parser {
if (docs == null) continue;
for (final Document d: docs) docacc.add(d);
} catch (final Parser.Failure e) {
- AbstractParser.log.logWarning("ZIP parser entry " + name + ": " + e.getMessage());
+ AbstractParser.log.warn("ZIP parser entry " + name + ": " + e.getMessage());
} finally {
if (tmp != null) FileUtils.deletedelete(tmp);
}
} catch (final IOException e) {
- AbstractParser.log.logWarning("ZIP parser:" + e.getMessage());
+ AbstractParser.log.warn("ZIP parser:" + e.getMessage());
break;
}
}
diff --git a/source/net/yacy/gui/framework/Browser.java b/source/net/yacy/gui/framework/Browser.java
index 69e20136d..5df724642 100644
--- a/source/net/yacy/gui/framework/Browser.java
+++ b/source/net/yacy/gui/framework/Browser.java
@@ -31,7 +31,7 @@ import java.io.InputStreamReader;
import java.net.URI;
import java.util.Properties;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class Browser {
@@ -162,7 +162,7 @@ public class Browser {
private static void logBrowserFail(final String url) {
//if (e != null) Log.logException(e);
- Log.logInfo("Browser", "please start your browser and open the following location: " + url);
+ ConcurrentLog.info("Browser", "please start your browser and open the following location: " + url);
}
private static String errorResponse(final Process p) {
@@ -179,7 +179,7 @@ public class Browser {
try {
err.close();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/interaction/AugmentHtmlStream.java b/source/net/yacy/interaction/AugmentHtmlStream.java
index d0793c46a..bb99d399e 100644
--- a/source/net/yacy/interaction/AugmentHtmlStream.java
+++ b/source/net/yacy/interaction/AugmentHtmlStream.java
@@ -13,8 +13,8 @@ import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.http.HTTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.server.http.ServerSideIncludes;
@@ -97,7 +97,7 @@ public class AugmentHtmlStream {
boolean augmented = false;
try {
- Log.logInfo("AUGMENTATION", url.getName());
+ ConcurrentLog.info("AUGMENTATION", url.getName());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
@@ -110,7 +110,7 @@ public class AugmentHtmlStream {
try {
Doc = processExternal("http://reflect.ws/REST/GetHTML", "document", Doc);
- Log.logInfo("AUGMENTATION", "reflected " + url);
+ ConcurrentLog.info("AUGMENTATION", "reflected " + url);
augmented = true;
} catch (Exception e) {
diff --git a/source/net/yacy/interaction/Interaction.java b/source/net/yacy/interaction/Interaction.java
index 0deba5d29..108441368 100644
--- a/source/net/yacy/interaction/Interaction.java
+++ b/source/net/yacy/interaction/Interaction.java
@@ -13,11 +13,11 @@ import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.http.HTTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.UserDB;
import net.yacy.kelondro.blob.Tables.Row;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.Seed;
import net.yacy.search.Switchboard;
@@ -134,7 +134,7 @@ public static String GetTableentry(String url, String type, String username) {
try {
Iterator<Row> it = sb.tables.iterator(username+"_contribution", "url", url.getBytes());
- Log.logInfo ("TABLE", "GET "+username+" / "+url+" - "+type+" ...");
+ ConcurrentLog.info ("TABLE", "GET "+username+" / "+url+" - "+type+" ...");
it = sb.tables.orderBy(it, -1, "timestamp_creation").iterator();
@@ -152,7 +152,7 @@ public static String GetTableentry(String url, String type, String username) {
e.printStackTrace();
}
- Log.logInfo ("TABLE", "GET "+username+" / "+url+" - "+type+" - "+retvalue);
+ ConcurrentLog.info ("TABLE", "GET "+username+" / "+url+" - "+type+" - "+retvalue);
return retvalue;
@@ -169,7 +169,7 @@ public static String Tableentry(String url, String type, String comment, String
Boolean processlocal = false;
- Log.logInfo ("TABLE", "PUT "+from+" / "+url+" - "+type+" - "+comment);
+ ConcurrentLog.info ("TABLE", "PUT "+from+" / "+url+" - "+type+" - "+comment);
if (!sb.getConfig("interaction.contribution.accumulationpeer", "").equals("")) {
@@ -181,7 +181,7 @@ public static String Tableentry(String url, String type, String comment, String
} else {
// Forward feedback to other peer
- Log.logInfo("INTERACTION", "Forwarding contribution to "+sb.getConfig("interaction.contribution.accumulationpeer", "")+": " + url + ": "
+ ConcurrentLog.info("INTERACTION", "Forwarding contribution to "+sb.getConfig("interaction.contribution.accumulationpeer", "")+": " + url + ": "
+ comment);
try {
@@ -220,7 +220,7 @@ public static String Tableentry(String url, String type, String comment, String
try {
sb.tables.insert(from+"_contribution", map);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/source/net/yacy/kelondro/blob/ArrayStack.java b/source/net/yacy/kelondro/blob/ArrayStack.java
index 5eb5636fa..e5f3ee2d1 100644
--- a/source/net/yacy/kelondro/blob/ArrayStack.java
+++ b/source/net/yacy/kelondro/blob/ArrayStack.java
@@ -55,9 +55,9 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceFactory;
@@ -211,7 +211,7 @@ public class ArrayStack implements BLOB {
sortedItems.put(Long.valueOf(time), new blobItem(d, f, oneBlob));
} catch (IOException e) {
if (deleteonfail) {
- Log.logWarning("ArrayStack", "cannot read file " + f.getName() + ", deleting it (smart fail; alternative would be: crash; required user action would be same as deletion)");
+ ConcurrentLog.warn("ArrayStack", "cannot read file " + f.getName() + ", deleting it (smart fail; alternative would be: crash; required user action would be same as deletion)");
f.delete();
} else {
throw new IOException(e.getMessage(), e);
@@ -278,7 +278,7 @@ public class ArrayStack implements BLOB {
return;
}
}
- Log.logSevere("BLOBArray", "file " + location + " cannot be unmounted. The file " + ((location.exists()) ? "exists." : "does not exist."));
+ ConcurrentLog.severe("BLOBArray", "file " + location + " cannot be unmounted. The file " + ((location.exists()) ? "exists." : "does not exist."));
}
private File unmount(final int idx) {
@@ -623,7 +623,7 @@ public class ArrayStack implements BLOB {
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
} catch (final ExecutionException e) {
- Log.logSevere("ArrayStack", "", e);
+ ConcurrentLog.severe("ArrayStack", "", e);
throw new RuntimeException(e.getCause());
}
//System.out.println("*DEBUG SplitTable fail.time = " + (System.currentTimeMillis() - start) + " ms");
@@ -663,9 +663,9 @@ public class ArrayStack implements BLOB {
try {
return get((byte[]) key);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return null;
}
@@ -700,10 +700,10 @@ public class ArrayStack implements BLOB {
final byte[] n = b.get(this.key);
if (n != null) return n;
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "BlobValues - IOException: " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "BlobValues - IOException: " + e.getMessage(), e);
return null;
} catch (final SpaceExceededException e) {
- Log.logSevere("ArrayStack", "BlobValues - RowSpaceExceededException: " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "BlobValues - RowSpaceExceededException: " + e.getMessage(), e);
break;
}
}
@@ -757,7 +757,7 @@ public class ArrayStack implements BLOB {
final long l = b.length(this.key);
if (l >= 0) return Long.valueOf(l);
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "", e);
+ ConcurrentLog.severe("ArrayStack", "", e);
return null;
}
}
@@ -906,34 +906,34 @@ public class ArrayStack implements BLOB {
final File newFile, final int writeBuffer) {
if (f2 == null) {
// this is a rewrite
- Log.logInfo("BLOBArray", "rewrite of " + f1.getName());
+ ConcurrentLog.info("BLOBArray", "rewrite of " + f1.getName());
final File resultFile = rewriteWorker(factory, this.keylength, this.ordering, f1, newFile, writeBuffer);
if (resultFile == null) {
- Log.logWarning("BLOBArray", "rewrite of file " + f1 + " returned null. newFile = " + newFile);
+ ConcurrentLog.warn("BLOBArray", "rewrite of file " + f1 + " returned null. newFile = " + newFile);
return null;
}
try {
mountBLOB(resultFile, false);
} catch (final IOException e) {
- Log.logWarning("BLOBArray", "rewrite of file " + f1 + " successfull, but read failed. resultFile = " + resultFile);
+ ConcurrentLog.warn("BLOBArray", "rewrite of file " + f1 + " successfull, but read failed. resultFile = " + resultFile);
return null;
}
- Log.logInfo("BLOBArray", "rewrite of " + f1.getName() + " into " + resultFile);
+ ConcurrentLog.info("BLOBArray", "rewrite of " + f1.getName() + " into " + resultFile);
return resultFile;
}
- Log.logInfo("BLOBArray", "merging " + f1.getName() + " with " + f2.getName());
+ ConcurrentLog.info("BLOBArray", "merging " + f1.getName() + " with " + f2.getName());
final File resultFile = mergeWorker(factory, this.keylength, this.ordering, f1, f2, newFile, writeBuffer);
if (resultFile == null) {
- Log.logWarning("BLOBArray", "merge of files " + f1 + ", " + f2 + " returned null. newFile = " + newFile);
+ ConcurrentLog.warn("BLOBArray", "merge of files " + f1 + ", " + f2 + " returned null. newFile = " + newFile);
return null;
}
try {
mountBLOB(resultFile, false);
} catch (final IOException e) {
- Log.logWarning("BLOBArray", "merge of files " + f1 + ", " + f2 + " successfull, but read failed. resultFile = " + resultFile);
+ ConcurrentLog.warn("BLOBArray", "merge of files " + f1 + ", " + f2 + " successfull, but read failed. resultFile = " + resultFile);
return null;
}
- Log.logInfo("BLOBArray", "merged " + f1.getName() + " with " + f2.getName() + " into " + resultFile);
+ ConcurrentLog.info("BLOBArray", "merged " + f1.getName() + " with " + f2.getName() + " into " + resultFile);
return resultFile;
}
@@ -969,12 +969,12 @@ public class ArrayStack implements BLOB {
merge(i1, i2, order, writer);
writer.close(true);
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "cannot writing or close writing merge, newFile = " + newFile.toString() + ", tmpFile = " + tmpFile.toString() + ": " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot writing or close writing merge, newFile = " + newFile.toString() + ", tmpFile = " + tmpFile.toString() + ": " + e.getMessage(), e);
HeapWriter.delete(tmpFile);
HeapWriter.delete(newFile);
return null;
} catch (final SpaceExceededException e) {
- Log.logSevere("ArrayStack", "cannot merge because of memory failure: " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot merge because of memory failure: " + e.getMessage(), e);
HeapWriter.delete(tmpFile);
HeapWriter.delete(newFile);
return null;
@@ -984,13 +984,13 @@ public class ArrayStack implements BLOB {
HeapWriter.delete(f2);
return newFile;
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "cannot merge because input files cannot be read, f2 = " + f2.toString() + ": " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot merge because input files cannot be read, f2 = " + f2.toString() + ": " + e.getMessage(), e);
return null;
} finally {
if (i2 != null) i2.close();
}
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "cannot merge because input files cannot be read, f1 = " + f1.toString() + ": " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot merge because input files cannot be read, f1 = " + f1.toString() + ": " + e.getMessage(), e);
return null;
} finally {
if (i1 != null) i1.close();
@@ -1006,7 +1006,7 @@ public class ArrayStack implements BLOB {
try {
i = new ReferenceIterator<ReferenceType>(f, factory);
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "cannot rewrite because input file cannot be read, f = " + f.toString() + ": " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot rewrite because input file cannot be read, f = " + f.toString() + ": " + e.getMessage(), e);
return null;
}
if (!i.hasNext()) {
@@ -1021,12 +1021,12 @@ public class ArrayStack implements BLOB {
writer.close(true);
i.close();
} catch (final IOException e) {
- Log.logSevere("ArrayStack", "cannot writing or close writing rewrite, newFile = " + newFile.toString() + ", tmpFile = " + tmpFile.toString() + ": " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot writing or close writing rewrite, newFile = " + newFile.toString() + ", tmpFile = " + tmpFile.toString() + ": " + e.getMessage(), e);
FileUtils.deletedelete(tmpFile);
FileUtils.deletedelete(newFile);
return null;
} catch (final SpaceExceededException e) {
- Log.logSevere("ArrayStack", "cannot rewrite because of memory failure: " + e.getMessage(), e);
+ ConcurrentLog.severe("ArrayStack", "cannot rewrite because of memory failure: " + e.getMessage(), e);
FileUtils.deletedelete(tmpFile);
FileUtils.deletedelete(newFile);
return null;
@@ -1053,7 +1053,7 @@ public class ArrayStack implements BLOB {
e = ordering.compare(c1.getTermHash(), c2.getTermHash());
if (e < 0) {
s = c1.shrinkReferences();
- if (s > 0) Log.logInfo("ArrayStack", "shrinking index for " + ASCII.String(c1.getTermHash()) + " by " + s + " to " + c1.size() + " entries");
+ if (s > 0) ConcurrentLog.info("ArrayStack", "shrinking index for " + ASCII.String(c1.getTermHash()) + " by " + s + " to " + c1.size() + " entries");
writer.add(c1.getTermHash(), c1.exportCollection());
if (i1.hasNext()) {
c1lh = c1.getTermHash();
@@ -1066,7 +1066,7 @@ public class ArrayStack implements BLOB {
}
if (e > 0) {
s = c2.shrinkReferences();
- if (s > 0) Log.logInfo("ArrayStack", "shrinking index for " + ASCII.String(c2.getTermHash()) + " by " + s + " to " + c2.size() + " entries");
+ if (s > 0) ConcurrentLog.info("ArrayStack", "shrinking index for " + ASCII.String(c2.getTermHash()) + " by " + s + " to " + c2.size() + " entries");
writer.add(c2.getTermHash(), c2.exportCollection());
if (i2.hasNext()) {
c2lh = c2.getTermHash();
@@ -1081,7 +1081,7 @@ public class ArrayStack implements BLOB {
// merge the entries
c1 = c1.merge(c2);
s = c1.shrinkReferences();
- if (s > 0) Log.logInfo("ArrayStack", "shrinking index for " + ASCII.String(c1.getTermHash()) + " by " + s + " to " + c1.size() + " entries");
+ if (s > 0) ConcurrentLog.info("ArrayStack", "shrinking index for " + ASCII.String(c1.getTermHash()) + " by " + s + " to " + c1.size() + " entries");
writer.add(c1.getTermHash(), c1.exportCollection());
c1lh = c1.getTermHash();
c2lh = c2.getTermHash();
@@ -1111,7 +1111,7 @@ public class ArrayStack implements BLOB {
while (c1 != null) {
//System.out.println("FLUSH REMAINING 1: " + c1.getWordHash());
s = c1.shrinkReferences();
- if (s > 0) Log.logInfo("ArrayStack", "shrinking index for " + ASCII.String(c1.getTermHash()) + " by " + s + " to " + c1.size() + " entries");
+ if (s > 0) ConcurrentLog.info("ArrayStack", "shrinking index for " + ASCII.String(c1.getTermHash()) + " by " + s + " to " + c1.size() + " entries");
writer.add(c1.getTermHash(), c1.exportCollection());
if (i1.hasNext()) {
c1lh = c1.getTermHash();
@@ -1124,7 +1124,7 @@ public class ArrayStack implements BLOB {
while (c2 != null) {
//System.out.println("FLUSH REMAINING 2: " + c2.getWordHash());
s = c2.shrinkReferences();
- if (s > 0) Log.logInfo("ArrayStack", "shrinking index for " + ASCII.String(c2.getTermHash()) + " by " + s + " to " + c2.size() + " entries");
+ if (s > 0) ConcurrentLog.info("ArrayStack", "shrinking index for " + ASCII.String(c2.getTermHash()) + " by " + s + " to " + c2.size() + " entries");
writer.add(c2.getTermHash(), c2.exportCollection());
if (i2.hasNext()) {
c2lh = c2.getTermHash();
@@ -1148,7 +1148,7 @@ public class ArrayStack implements BLOB {
while (true) {
assert c != null;
s = c.shrinkReferences();
- if (s > 0) Log.logInfo("ArrayStack", "shrinking index for " + ASCII.String(c.getTermHash()) + " by " + s + " to " + c.size() + " entries");
+ if (s > 0) ConcurrentLog.info("ArrayStack", "shrinking index for " + ASCII.String(c.getTermHash()) + " by " + s + " to " + c.size() + " entries");
writer.add(c.getTermHash(), c.exportCollection());
if (i.hasNext()) {
clh = c.getTermHash();
@@ -1180,7 +1180,7 @@ public class ArrayStack implements BLOB {
heap.insert("aaaaaaaaaaaX".getBytes(), "WXYZ".getBytes());
heap.close(true);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/blob/BEncodedHeap.java b/source/net/yacy/kelondro/blob/BEncodedHeap.java
index dcb505bbf..33a595f68 100644
--- a/source/net/yacy/kelondro/blob/BEncodedHeap.java
+++ b/source/net/yacy/kelondro/blob/BEncodedHeap.java
@@ -44,8 +44,8 @@ import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.Digest;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.storage.MapStore;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.BDecoder;
import net.yacy.kelondro.util.BDecoder.BObject;
import net.yacy.kelondro.util.BEncoder;
@@ -99,7 +99,7 @@ public class BEncodedHeap implements MapStore {
try {
return this.table.keys(true, false);
} catch (IOException e) {
- Log.logSevere("BEncodedHeap", "returning empty iterator for failed key iteration: " + e.getMessage(), e);
+ ConcurrentLog.severe("BEncodedHeap", "returning empty iterator for failed key iteration: " + e.getMessage(), e);
return new CloneableIterator<byte[]>(){
@Override
@@ -297,10 +297,10 @@ public class BEncodedHeap implements MapStore {
try {
return get((byte[]) key);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -444,10 +444,10 @@ public class BEncodedHeap implements MapStore {
this.columnames.addAll(map.keySet());
return entry;
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -481,10 +481,10 @@ public class BEncodedHeap implements MapStore {
try {
return remove((byte[]) key);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -502,9 +502,9 @@ public class BEncodedHeap implements MapStore {
try {
this.insert(me.getKey(), me.getValue());
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -518,7 +518,7 @@ public class BEncodedHeap implements MapStore {
this.table.clear();
this.columnames.clear();
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -609,7 +609,7 @@ public class BEncodedHeap implements MapStore {
this.table = new Heap(location, keylen, order, buffermax);
return iter;
} catch ( final IOException e ) {
- Log.logSevere("PropertiesTable", e.getMessage(), e);
+ ConcurrentLog.severe("PropertiesTable", e.getMessage(), e);
return null;
}
}
@@ -685,9 +685,9 @@ public class BEncodedHeap implements MapStore {
// clean up
map.close();
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
final File f = new File(args[0]);
@@ -701,7 +701,7 @@ public class BEncodedHeap implements MapStore {
}
map.close();
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/kelondro/blob/BEncodedHeapBag.java b/source/net/yacy/kelondro/blob/BEncodedHeapBag.java
index 03073d765..bd024dd69 100644
--- a/source/net/yacy/kelondro/blob/BEncodedHeapBag.java
+++ b/source/net/yacy/kelondro/blob/BEncodedHeapBag.java
@@ -41,8 +41,8 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.storage.AbstractMapStore;
import net.yacy.cora.storage.MapStore;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MergeIterator;
@@ -97,7 +97,7 @@ public class BEncodedHeapBag extends AbstractMapStore implements MapStore {
try {
d = GenericFormatter.SHORT_MILSEC_FORMATTER.parse(element.substring(this.prefix.length() + 1, this.prefix.length() + 18));
} catch (final ParseException e) {
- Log.logSevere("BEncodedHeapBag", "", e);
+ ConcurrentLog.severe("BEncodedHeapBag", "", e);
continue;
}
time = d.getTime();
@@ -134,11 +134,11 @@ public class BEncodedHeapBag extends AbstractMapStore implements MapStore {
t.remove(maxf);
f = new File(this.baseDir, maxf);
try {
- Log.logInfo("BEncodedHeapBag", "opening partial heap " + f);
+ ConcurrentLog.info("BEncodedHeapBag", "opening partial heap " + f);
BEncodedHeap heap = new BEncodedHeap(f, this.keylength, this.entryOrder, this.buffermax);
this.bag.put(maxf, heap);
} catch (IOException e) {
- Log.logSevere("BEncodedHeapBag", "error opening partial heap " + f);
+ ConcurrentLog.severe("BEncodedHeapBag", "error opening partial heap " + f);
}
}
}
@@ -187,7 +187,7 @@ public class BEncodedHeapBag extends AbstractMapStore implements MapStore {
try {
heap = new BEncodedHeap(f, this.keylength, this.entryOrder, this.buffermax);
} catch (IOException e) {
- Log.logSevere("BEncodedHeapBag", "unable to open new heap file: " + e.getMessage(), e);
+ ConcurrentLog.severe("BEncodedHeapBag", "unable to open new heap file: " + e.getMessage(), e);
return null;
}
this.bag.put(this.current, heap);
@@ -205,7 +205,7 @@ public class BEncodedHeapBag extends AbstractMapStore implements MapStore {
try {
d = GenericFormatter.SHORT_MILSEC_FORMATTER.parse(name.substring(this.prefix.length() + 1, this.prefix.length() + 18)).getTime();
} catch (final ParseException e) {
- Log.logSevere("BEncodedHeapBag", "", e);
+ ConcurrentLog.severe("BEncodedHeapBag", "", e);
d = 0;
}
if (d + this.fileAgeLimit < t || new File(this.baseDir, name).length() >= this.fileSizeLimit) {
@@ -333,7 +333,7 @@ public class BEncodedHeapBag extends AbstractMapStore implements MapStore {
}
System.out.println("test size after remove = " + hb.size());
hb.close();
- Log.shutdown();
+ ConcurrentLog.shutdown();
}
}
diff --git a/source/net/yacy/kelondro/blob/BEncodedHeapShard.java b/source/net/yacy/kelondro/blob/BEncodedHeapShard.java
index 170daa4c2..8f3723587 100644
--- a/source/net/yacy/kelondro/blob/BEncodedHeapShard.java
+++ b/source/net/yacy/kelondro/blob/BEncodedHeapShard.java
@@ -38,8 +38,8 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.storage.AbstractMapStore;
import net.yacy.cora.storage.MapStore;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MergeIterator;
@@ -146,7 +146,7 @@ public class BEncodedHeapShard extends AbstractMapStore implements MapStore {
// open all tables of this shard
for (final String element : tablefile) {
if (this.shardMethod.isShardPart(element)) {
- Log.logInfo("BEncodedHeapShard", "opening partial shard " + element);
+ ConcurrentLog.info("BEncodedHeapShard", "opening partial shard " + element);
MapStore bag = openBag(element);
this.shard.put(this.shardMethod.getShardName(element), bag);
}
@@ -294,6 +294,6 @@ public class BEncodedHeapShard extends AbstractMapStore implements MapStore {
}
System.out.println("test size after remove = " + hb.size());
hb.close();
- Log.shutdown();
+ ConcurrentLog.shutdown();
}
}
diff --git a/source/net/yacy/kelondro/blob/Compressor.java b/source/net/yacy/kelondro/blob/Compressor.java
index ffc2f095c..c78d545e4 100644
--- a/source/net/yacy/kelondro/blob/Compressor.java
+++ b/source/net/yacy/kelondro/blob/Compressor.java
@@ -40,8 +40,8 @@ import java.util.zip.GZIPOutputStream;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteArray;
import net.yacy.kelondro.util.MemoryControl;
@@ -120,7 +120,7 @@ public class Compressor implements BLOB, Iterable<byte[]> {
baos.close();
return baos.toByteArray();
} catch (final IOException e) {
- Log.logSevere("Compressor", "", e);
+ ConcurrentLog.severe("Compressor", "", e);
return null;
}
}
@@ -157,7 +157,7 @@ public class Compressor implements BLOB, Iterable<byte[]> {
return baos.toByteArray();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
} else if (ByteArray.startsWith(b, plainMagic)) {
@@ -200,9 +200,9 @@ public class Compressor implements BLOB, Iterable<byte[]> {
try {
return get((byte[]) key);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return null;
}
@@ -224,7 +224,7 @@ public class Compressor implements BLOB, Iterable<byte[]> {
try {
return this.backend.length() + this.bufferlength;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return 0;
}
}
diff --git a/source/net/yacy/kelondro/blob/Heap.java b/source/net/yacy/kelondro/blob/Heap.java
index 54bf54d8c..4df4034c8 100644
--- a/source/net/yacy/kelondro/blob/Heap.java
+++ b/source/net/yacy/kelondro/blob/Heap.java
@@ -38,9 +38,9 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.io.AbstractWriter;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MemoryControl;
@@ -89,7 +89,7 @@ public final class Heap extends HeapModifier implements BLOB {
this.buffermax = buffermax;
this.buffer = new TreeMap<byte[], byte[]>(ordering);
this.buffersize = 0;
- Log.logInfo("Heap", "initializing heap " + this.name());
+ ConcurrentLog.info("Heap", "initializing heap " + this.name());
/*
// DEBUG
Iterator<byte[]> i = index.keys(true, null);
@@ -281,7 +281,7 @@ public final class Heap extends HeapModifier implements BLOB {
*/
@Override
public synchronized void clear() throws IOException {
- Log.logInfo("Heap", "clearing heap " + this.name());
+ ConcurrentLog.info("Heap", "clearing heap " + this.name());
assert this.buffer != null;
if (this.buffer == null) this.buffer = new TreeMap<byte[], byte[]>(this.ordering);
this.buffer.clear();
@@ -294,12 +294,12 @@ public final class Heap extends HeapModifier implements BLOB {
*/
@Override
public synchronized void close(final boolean writeIDX) {
- Log.logInfo("Heap", "closing heap " + this.name());
+ ConcurrentLog.info("Heap", "closing heap " + this.name());
if (this.file != null && this.buffer != null) {
try {
flushBuffer();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
this.buffer = null;
@@ -542,7 +542,7 @@ public final class Heap extends HeapModifier implements BLOB {
heap.insert("aaaaaaaaaaaX".getBytes(), "WXYZ".getBytes());
heap.close(true);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -566,9 +566,9 @@ public final class Heap extends HeapModifier implements BLOB {
heap.insert("aaaaaaaaaaaX".getBytes(), map("aaaaaaaaaaad", "WXYZ"));
heap.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/blob/HeapModifier.java b/source/net/yacy/kelondro/blob/HeapModifier.java
index 14afae051..c61c5c8c0 100644
--- a/source/net/yacy/kelondro/blob/HeapModifier.java
+++ b/source/net/yacy/kelondro/blob/HeapModifier.java
@@ -30,9 +30,9 @@ import java.util.SortedMap;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.ByteOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.io.CachedFileWriter;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -120,7 +120,7 @@ public class HeapModifier extends HeapReader implements BLOB {
//assert seek + size + 4 <= this.file.length() : heapFile.getName() + ": too long size " + size + " in record at " + seek;
long filelength = this.file.length(); // put in separate variable for debugging
if (seek + size + 4 > filelength) {
- Log.logSevere("BLOBHeap", this.heapFile.getName() + ": too long size " + size + " in record at " + seek);
+ ConcurrentLog.severe("BLOBHeap", this.heapFile.getName() + ": too long size " + size + " in record at " + seek);
throw new IOException(this.heapFile.getName() + ": too long size " + size + " in record at " + seek);
}
super.deleteFingerprint();
@@ -237,7 +237,7 @@ public class HeapModifier extends HeapReader implements BLOB {
this.free.remove(seek);
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java
index 70d711ecc..7a05d4196 100644
--- a/source/net/yacy/kelondro/blob/HeapReader.java
+++ b/source/net/yacy/kelondro/blob/HeapReader.java
@@ -43,12 +43,12 @@ import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.Digest;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.storage.HandleMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.RowHandleMap;
import net.yacy.kelondro.io.CachedFileWriter;
import net.yacy.kelondro.io.Writer;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.RotateIterator;
@@ -58,7 +58,7 @@ public class HeapReader {
//public final static long keepFreeMem = 20 * 1024 * 1024;
- private final static Log log = new Log("HeapReader");
+ private final static ConcurrentLog log = new ConcurrentLog("HeapReader");
// input values
protected int keylength; // the length of the primary key
@@ -107,10 +107,10 @@ public class HeapReader {
}
}
if (!ok) {
- log.logWarning("verification of idx file for " + heapFile.toString() + " failed, re-building index");
+ log.warn("verification of idx file for " + heapFile.toString() + " failed, re-building index");
initIndexReadFromHeap();
} else {
- log.logInfo("using a dump of the index of " + heapFile.toString() + ".");
+ log.info("using a dump of the index of " + heapFile.toString() + ".");
}
} else {
// if we did not have a dump, create a new index
@@ -161,7 +161,7 @@ public class HeapReader {
// if this is successful, return true; otherwise false
String fingerprint = fingerprintFileHash(this.heapFile);
if (fingerprint == null) {
- log.logSevere("cannot generate a fingerprint for " + this.heapFile + ": null");
+ log.severe("cannot generate a fingerprint for " + this.heapFile + ": null");
return false;
}
this.fingerprintFileIdx = HeapWriter.fingerprintIndexFile(this.heapFile, fingerprint);
@@ -178,17 +178,17 @@ public class HeapReader {
try {
this.index = new RowHandleMap(this.keylength, this.ordering, 8, this.fingerprintFileIdx);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
// check saturation
if (this.index instanceof RowHandleMap) {
int[] saturation = ((RowHandleMap) this.index).saturation(); // {<the maximum length of consecutive equal-beginning bytes in the key>, <the minimum number of leading zeros in the second column>}
- log.logInfo("saturation of " + this.fingerprintFileIdx.getName() + ": keylength = " + saturation[0] + ", vallength = " + saturation[1] + ", size = " + this.index.size() +
+ log.info("saturation of " + this.fingerprintFileIdx.getName() + ": keylength = " + saturation[0] + ", vallength = " + saturation[1] + ", size = " + this.index.size() +
", maximum saving for index-compression = " + (saturation[0] * this.index.size() / 1024 / 1024) + " MB" +
", exact saving for value-compression = " + (saturation[1] * this.index.size() / 1024 / 1024) + " MB");
}
@@ -197,7 +197,7 @@ public class HeapReader {
try {
this.free = new Gap(this.fingerprintFileGap);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
@@ -249,7 +249,7 @@ public class HeapReader {
private void initIndexReadFromHeap() throws IOException {
// this initializes the this.index object by reading positions from the heap file
- log.logInfo("generating index for " + this.heapFile.toString() + ", " + (this.file.length() / 1024 / 1024) + " MB. Please wait.");
+ log.info("generating index for " + this.heapFile.toString() + ", " + (this.file.length() / 1024 / 1024) + " MB. Please wait.");
this.free = new Gap();
RowHandleMap.initDataConsumer indexready = RowHandleMap.asynchronusInitializer(this.name() + ".initializer", this.keylength, this.ordering, 8, Math.max(10, (int) (Runtime.getRuntime().freeMemory() / (10 * 1024 * 1024))));
@@ -268,7 +268,7 @@ public class HeapReader {
//assert reclen > 0 : " reclen == 0 at seek pos " + seek;
if (reclen == 0) {
// very bad file inconsistency
- log.logSevere("reclen == 0 at seek pos " + seek + " in file " + this.heapFile);
+ log.severe("reclen == 0 at seek pos " + seek + " in file " + this.heapFile);
this.file.setLength(seek); // delete everything else at the remaining of the file :-(
break loop;
}
@@ -295,7 +295,7 @@ public class HeapReader {
this.file.seek(seek + 4);
Arrays.fill(key, (byte) 0);
this.file.write(key); // mark the place as empty record
- log.logWarning("BLOB " + this.heapFile.getName() + ": skiped not wellformed key " + UTF8.String(key) + " at seek pos " + seek);
+ log.warn("BLOB " + this.heapFile.getName() + ": skiped not wellformed key " + UTF8.String(key) + " at seek pos " + seek);
}
}
// new seek position
@@ -308,11 +308,11 @@ public class HeapReader {
try {
this.index = indexready.result();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (ExecutionException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- log.logInfo("finished index generation for " + this.heapFile.toString() + ", " + this.index.size() + " entries, " + this.free.size() + " gaps.");
+ log.info("finished index generation for " + this.heapFile.toString() + ", " + this.index.size() + " entries, " + this.free.size() + " gaps.");
}
private void mergeFreeEntries() throws IOException {
@@ -340,7 +340,7 @@ public class HeapReader {
lastFree = nextFree;
}
}
- log.logInfo("BLOB " + this.heapFile.toString() + ": merged " + merged + " free records");
+ log.info("BLOB " + this.heapFile.toString() + ": merged " + merged + " free records");
if (merged > 0) deleteFingerprint();
}
}
@@ -360,7 +360,7 @@ public class HeapReader {
public int size() {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in size(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in size(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return 0;
}
synchronized (this.index) {
@@ -371,7 +371,7 @@ public class HeapReader {
public boolean isEmpty() {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in isEmpty(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in isEmpty(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return true;
}
synchronized (this.index) {
@@ -387,7 +387,7 @@ public class HeapReader {
public boolean containsKey(byte[] key) {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in containsKey(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in containsKey(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return false;
}
key = normalizeKey(key);
@@ -412,7 +412,7 @@ public class HeapReader {
protected synchronized byte[] firstKey() throws IOException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in firstKey(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in firstKey(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
synchronized (this.index) {
@@ -430,7 +430,7 @@ public class HeapReader {
protected byte[] first() throws IOException, SpaceExceededException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in first(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in first(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
synchronized (this.index) {
@@ -450,7 +450,7 @@ public class HeapReader {
protected byte[] lastKey() throws IOException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in lastKey(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in lastKey(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
if (this.index == null) return null;
@@ -469,7 +469,7 @@ public class HeapReader {
protected byte[] last() throws IOException, SpaceExceededException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in last(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in last(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
synchronized (this.index) {
@@ -488,7 +488,7 @@ public class HeapReader {
public byte[] get(byte[] key) throws IOException, SpaceExceededException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in get(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in get(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
key = normalizeKey(key);
@@ -503,7 +503,7 @@ public class HeapReader {
final int len = this.file.readInt() - this.keylength;
if (len < 0) {
// database file may be corrupted and should be deleted :-((
- log.logSevere("file " + this.file.file() + " corrupted at " + pos + ": negative len. len = " + len + ", pk.len = " + this.keylength);
+ log.severe("file " + this.file.file() + " corrupted at " + pos + ": negative len. len = " + len + ", pk.len = " + this.keylength);
// to get lazy over that problem (who wants to tell the user to stop operation and delete the file???) we work on like the entry does not exist
this.index.remove(key);
return null;
@@ -523,7 +523,7 @@ public class HeapReader {
this.file.readFully(keyf, 0, keyf.length);
if (!this.ordering.equal(key, keyf)) {
// verification of the indexed access failed. we must re-read the index
- log.logSevere("indexed verification access failed for " + this.heapFile.toString());
+ log.severe("indexed verification access failed for " + this.heapFile.toString());
// this is a severe operation, it should never happen.
// remove entry from index because keeping that element in the index would not make sense
this.index.remove(key);
@@ -552,9 +552,9 @@ public class HeapReader {
try {
return get((byte[]) key);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return null;
}
@@ -579,7 +579,7 @@ public class HeapReader {
public long length(byte[] key) throws IOException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in length(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in length(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return 0;
}
key = normalizeKey(key);
@@ -605,7 +605,7 @@ public class HeapReader {
try {
this.file.close();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.file = null;
if (writeIDX && this.index != null && this.free != null && (this.index.size() > 3 || this.free.size() > 3)) {
@@ -614,17 +614,17 @@ public class HeapReader {
try {
String fingerprint = fingerprintFileHash(this.heapFile);
if (fingerprint == null) {
- log.logSevere("cannot write a dump for " + this.heapFile.getName()+ ": fingerprint is null");
+ log.severe("cannot write a dump for " + this.heapFile.getName()+ ": fingerprint is null");
} else {
File newFingerprintFileGap = HeapWriter.fingerprintGapFile(this.heapFile, fingerprint);
if (this.fingerprintFileGap != null &&
this.fingerprintFileGap.getName().equals(newFingerprintFileGap.getName()) &&
this.fingerprintFileGap.exists()) {
- log.logInfo("using existing gap dump instead of writing a new one: " + this.fingerprintFileGap.getName());
+ log.info("using existing gap dump instead of writing a new one: " + this.fingerprintFileGap.getName());
} else {
long start = System.currentTimeMillis();
this.free.dump(newFingerprintFileGap);
- log.logInfo("wrote a dump for the " + this.free.size() + " gap entries of " + this.heapFile.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");
+ log.info("wrote a dump for the " + this.free.size() + " gap entries of " + this.heapFile.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");
}
}
this.free.clear();
@@ -634,17 +634,17 @@ public class HeapReader {
if (this.fingerprintFileIdx != null &&
this.fingerprintFileIdx.getName().equals(newFingerprintFileIdx.getName()) &&
this.fingerprintFileIdx.exists()) {
- log.logInfo("using existing idx dump instead of writing a new one: " + this.fingerprintFileIdx.getName());
+ log.info("using existing idx dump instead of writing a new one: " + this.fingerprintFileIdx.getName());
} else {
long start = System.currentTimeMillis();
this.index.dump(newFingerprintFileIdx);
- log.logInfo("wrote a dump for the " + this.index.size() + " index entries of " + this.heapFile.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");
+ log.info("wrote a dump for the " + this.index.size() + " index entries of " + this.heapFile.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");
}
}
this.index.close();
this.index = null;
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
if (this.free != null) this.free.clear();
@@ -652,7 +652,7 @@ public class HeapReader {
if (this.index != null) this.index.close();
this.index = null;
this.closeDate = new Date();
- log.logInfo("close HeapFile " + this.heapFile.getName() + "; trace: " + Log.stackTrace());
+ log.info("close HeapFile " + this.heapFile.getName() + "; trace: " + ConcurrentLog.stackTrace());
}
}
@@ -683,7 +683,7 @@ public class HeapReader {
public CloneableIterator<byte[]> keys(final boolean up, final boolean rotating) throws IOException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in keys(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in keys(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
synchronized (this.index) {
@@ -701,7 +701,7 @@ public class HeapReader {
public CloneableIterator<byte[]> keys(final boolean up, final byte[] firstKey) throws IOException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in keys(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in keys(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return null;
}
synchronized (this.index) {
@@ -712,7 +712,7 @@ public class HeapReader {
public long length() {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now=" + new Date();
if (this.index == null) {
- log.logSevere("this.index == null in length(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
+ log.severe("this.index == null in length(); closeDate=" + this.closeDate + ", now=" + new Date() + this.heapFile == null ? "" : (" file = " + this.heapFile.toString()));
return 0;
}
synchronized (this.index) {
@@ -752,7 +752,7 @@ public class HeapReader {
try {
return new entries(this.blobFile, this.keylen);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -774,7 +774,7 @@ public class HeapReader {
// read some more bytes to consume the empty record
if (len > 1) {
if (len - 1 != this.is.skipBytes(len - 1)) { // all that is remaining
- log.logWarning("problem skiping " + + len + " bytes in " + this.blobFile.getName());
+ log.warn("problem skiping " + + len + " bytes in " + this.blobFile.getName());
try {this.is.close();} catch (IOException e) {}
return null;
}
@@ -805,7 +805,7 @@ public class HeapReader {
// the allocation of memory for the payload may fail
// this is bad because we must interrupt the iteration here but the
// process that uses the iteration may think that the iteraton has just been completed
- log.logSevere("out of memory in LookAheadIterator.next0", ee);
+ log.severe("out of memory in LookAheadIterator.next0", ee);
try {this.is.close();} catch (IOException e) {}
return null;
}
@@ -817,7 +817,7 @@ public class HeapReader {
@Override
public synchronized void close() {
- if (this.is != null) try { this.is.close(); } catch (final IOException e) {Log.logException(e);}
+ if (this.is != null) try { this.is.close(); } catch (final IOException e) {ConcurrentLog.logException(e);}
this.is = null;
}
}
@@ -859,7 +859,7 @@ public class HeapReader {
System.out.println(ASCII.String(entry.getKey()) + ":" + UTF8.String(entry.getValue()));
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/blob/HeapWriter.java b/source/net/yacy/kelondro/blob/HeapWriter.java
index 14c84b572..fd9d48841 100644
--- a/source/net/yacy/kelondro/blob/HeapWriter.java
+++ b/source/net/yacy/kelondro/blob/HeapWriter.java
@@ -33,15 +33,15 @@ import java.io.IOException;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.storage.HandleMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.RowHandleMap;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
public final class HeapWriter {
- private final static Log log = new Log("HeapWriter");
+ private final static ConcurrentLog log = new ConcurrentLog("HeapWriter");
public final static byte[] ZERO = new byte[]{0};
private final int keylength; // the length of the primary key
@@ -140,11 +140,11 @@ public final class HeapWriter {
long start = System.currentTimeMillis();
String fingerprint = HeapReader.fingerprintFileHash(this.heapFileREADY);
if (fingerprint == null) {
- log.logSevere("cannot write a dump for " + this.heapFileREADY.getName()+ ": fingerprint is null");
+ log.severe("cannot write a dump for " + this.heapFileREADY.getName()+ ": fingerprint is null");
} else {
new Gap().dump(fingerprintGapFile(this.heapFileREADY, fingerprint));
this.index.dump(fingerprintIndexFile(this.heapFileREADY, fingerprint));
- log.logInfo("wrote a dump for the " + this.index.size() + " index entries of " + this.heapFileREADY.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");
+ log.info("wrote a dump for the " + this.index.size() + " index entries of " + this.heapFileREADY.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");
}
this.index.close();
this.index = null;
diff --git a/source/net/yacy/kelondro/blob/MapDataMining.java b/source/net/yacy/kelondro/blob/MapDataMining.java
index 888b66a97..d46172e88 100644
--- a/source/net/yacy/kelondro/blob/MapDataMining.java
+++ b/source/net/yacy/kelondro/blob/MapDataMining.java
@@ -44,9 +44,9 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.sorting.ConcurrentScoreMap;
import net.yacy.cora.sorting.ScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
public class MapDataMining extends MapHeap {
@@ -121,7 +121,7 @@ public class MapDataMining extends MapHeap {
try {
map = super.get(mapnameb);
} catch (final SpaceExceededException e) {
- Log.logWarning("MapDataMining", e.getMessage());
+ ConcurrentLog.warn("MapDataMining", e.getMessage());
break;
}
if (map == null) break;
@@ -299,7 +299,7 @@ public class MapDataMining extends MapHeap {
}
} catch (final SpaceExceededException e) {
map = null;
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
super.delete(key);
diff --git a/source/net/yacy/kelondro/blob/MapHeap.java b/source/net/yacy/kelondro/blob/MapHeap.java
index 849f3cc49..78b99d9df 100644
--- a/source/net/yacy/kelondro/blob/MapHeap.java
+++ b/source/net/yacy/kelondro/blob/MapHeap.java
@@ -50,9 +50,9 @@ import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.storage.ARC;
import net.yacy.cora.storage.ConcurrentARC;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.RotateIterator;
@@ -101,7 +101,7 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
try {
this.blob.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.cache.clear();
}
@@ -187,9 +187,9 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
v = this.get(key);
insert(key, newMap);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return v;
}
@@ -220,7 +220,7 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
v = this.get(key);
delete((byte[]) key);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return v;
}
@@ -263,9 +263,9 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
if (key instanceof byte[]) return get((byte[]) key);
if (key instanceof String) return get(UTF8.getBytes((String) key));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return null;
}
@@ -484,10 +484,10 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
try {
map = get(nextKey, false);
} catch (final IOException e) {
- Log.logWarning("MapDataMining", e.getMessage());
+ ConcurrentLog.warn("MapDataMining", e.getMessage());
continue;
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
if (map == null) continue; // circumvention of a modified exception
@@ -506,9 +506,9 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
try {
insert(me.getKey(), me.getValue());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -585,9 +585,9 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
// clean up
map.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/kelondro/blob/Stack.java b/source/net/yacy/kelondro/blob/Stack.java
index 174d5a015..303df0f2b 100644
--- a/source/net/yacy/kelondro/blob/Stack.java
+++ b/source/net/yacy/kelondro/blob/Stack.java
@@ -29,8 +29,8 @@ import java.io.IOException;
import java.util.Iterator;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
public class Stack {
@@ -196,7 +196,7 @@ public class Stack {
try {
b = this.stack.get(k);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
b = null;
}
assert b != null;
diff --git a/source/net/yacy/kelondro/blob/Stacks.java b/source/net/yacy/kelondro/blob/Stacks.java
index 7d5c4c6a6..6f0c73e6e 100644
--- a/source/net/yacy/kelondro/blob/Stacks.java
+++ b/source/net/yacy/kelondro/blob/Stacks.java
@@ -29,8 +29,8 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
public class Stacks {
@@ -62,7 +62,7 @@ public class Stacks {
si = new StackInstance(new File(this.stacksLocation, s));
this.stacks.put(si.name, si);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -95,7 +95,7 @@ public class Stacks {
this.stacks.put(stack, si);
return si.stack;
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/kelondro/blob/Tables.java b/source/net/yacy/kelondro/blob/Tables.java
index d3bf15f12..4e8b79b14 100644
--- a/source/net/yacy/kelondro/blob/Tables.java
+++ b/source/net/yacy/kelondro/blob/Tables.java
@@ -46,10 +46,10 @@ import java.util.regex.Pattern;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ymark.YMarkUtil;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteArray;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.FileUtils;
@@ -142,7 +142,7 @@ public class Tables implements Iterable<String> {
bheap = this.getHeap(idx_table);
} catch (IOException e) {
bheap = null;
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if(bheap != null) {
index = new TablesColumnBLOBIndex(bheap);
@@ -167,7 +167,7 @@ public class Tables implements Iterable<String> {
return true;
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return false;
}
@@ -199,7 +199,7 @@ public class Tables implements Iterable<String> {
}
} catch (Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return new HashSet<Row>().iterator();
}
} else if (!separator.isEmpty()) {
@@ -218,14 +218,14 @@ public class Tables implements Iterable<String> {
try {
return this.iterator(table, whereColumn, p);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return new HashSet<Row>().iterator();
}
} else {
try {
return this.iterator(table, whereColumn, UTF8.getBytes(whereValue));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return new HashSet<Row>().iterator();
}
}
@@ -277,7 +277,7 @@ public class Tables implements Iterable<String> {
heap = null;
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
this.tables.remove(tablename);
}
@@ -713,7 +713,7 @@ public class Tables implements Iterable<String> {
// clean up
map.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/blob/TablesColumnBLOBIndex.java b/source/net/yacy/kelondro/blob/TablesColumnBLOBIndex.java
index 8f5f27896..6d4a98f06 100644
--- a/source/net/yacy/kelondro/blob/TablesColumnBLOBIndex.java
+++ b/source/net/yacy/kelondro/blob/TablesColumnBLOBIndex.java
@@ -31,9 +31,9 @@ import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ymark.YMarkUtil;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteBuffer;
public class TablesColumnBLOBIndex extends TablesColumnIndex{
@@ -70,9 +70,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
try {
this.index.remove(column);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -103,9 +103,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
this.index.insert(column, valueIdxMap);
return;
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -128,9 +128,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
try {
this.index.insert(entry.getKey(), entry.getValue());
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -153,9 +153,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
try {
return new TreeSet<String>(this.index.get(column).keySet());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return new TreeSet<String>();
@@ -168,9 +168,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
try {
return this.index.get(column).containsKey(key);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return false;
@@ -189,9 +189,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
try {
return byteToCollection(this.index.get(column).get(key));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return new ArrayList<byte[]>();
}
@@ -203,9 +203,9 @@ public class TablesColumnBLOBIndex extends TablesColumnIndex{
try {
return this.index.get(column).size();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return -1;
diff --git a/source/net/yacy/kelondro/data/meta/DigestURI.java b/source/net/yacy/kelondro/data/meta/DigestURI.java
index 488a781dc..24bcd3db6 100644
--- a/source/net/yacy/kelondro/data/meta/DigestURI.java
+++ b/source/net/yacy/kelondro/data/meta/DigestURI.java
@@ -40,8 +40,8 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteArray;
/**
@@ -71,7 +71,7 @@ public class DigestURI extends MultiProtocolURI implements Serializable {
try {
url = new DigestURI(h);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
return (url == null) ? null : ASCII.String(url.hash(), 6, 6);
diff --git a/source/net/yacy/kelondro/data/meta/URIMetadataNode.java b/source/net/yacy/kelondro/data/meta/URIMetadataNode.java
index e362f6139..ed4754e7b 100644
--- a/source/net/yacy/kelondro/data/meta/URIMetadataNode.java
+++ b/source/net/yacy/kelondro/data/meta/URIMetadataNode.java
@@ -38,10 +38,10 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.federate.solr.SolrType;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.order.Base64Order;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Response;
import net.yacy.document.Condenser;
import net.yacy.kelondro.data.word.WordReferenceVars;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.search.schema.CollectionSchema;
import net.yacy.utils.crypt;
@@ -78,7 +78,7 @@ public class URIMetadataNode {
try {
this.url = new DigestURI(this.urlRaw, this.hash);
} catch (MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.url = null;
}
}
@@ -369,7 +369,7 @@ public class URIMetadataNode {
}
return s;
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
index 65c163632..a6351588c 100644
--- a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
+++ b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
@@ -40,13 +40,13 @@ import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Request;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.data.word.WordReferenceVars;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.io.CharBuffer;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.MapTools;
@@ -180,14 +180,14 @@ public class URIMetadataRow {
public static URIMetadataRow importEntry(final String propStr) {
if (propStr == null || propStr.isEmpty() || propStr.charAt(0) != '{' || !propStr.endsWith("}")) {
- Log.logSevere("URIMetadataRow", "importEntry: propStr is not proper: " + propStr);
+ ConcurrentLog.severe("URIMetadataRow", "importEntry: propStr is not proper: " + propStr);
return null;
}
try {
return new URIMetadataRow(MapTools.s2p(propStr.substring(1, propStr.length() - 1)));
} catch (final kelondroException e) {
// wrong format
- Log.logSevere("URIMetadataRow", e.getMessage());
+ ConcurrentLog.severe("URIMetadataRow", e.getMessage());
return null;
}
}
@@ -427,7 +427,7 @@ public class URIMetadataRow {
}
return s;
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/kelondro/data/word/Word.java b/source/net/yacy/kelondro/data/word/Word.java
index 701037c7e..ca93fa7ca 100644
--- a/source/net/yacy/kelondro/data/word/Word.java
+++ b/source/net/yacy/kelondro/data/word/Word.java
@@ -34,9 +34,9 @@ import net.yacy.cora.order.Digest;
import net.yacy.cora.storage.ARC;
import net.yacy.cora.storage.ConcurrentARC;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.MemoryControl;
@@ -58,10 +58,10 @@ public class Word {
static {
try {
hashCache = new ConcurrentARC<String, byte[]>(hashCacheSize, Math.min(32, 2 * Runtime.getRuntime().availableProcessors()));
- Log.logInfo("Word", "hashCache.size = " + hashCacheSize);
+ ConcurrentLog.info("Word", "hashCache.size = " + hashCacheSize);
} catch (final OutOfMemoryError e) {
hashCache = new ConcurrentARC<String, byte[]>(1000, Math.min(8, 1 + Runtime.getRuntime().availableProcessors()));
- Log.logInfo("Word", "hashCache.size = " + 1000);
+ ConcurrentLog.info("Word", "hashCache.size = " + 1000);
}
}
/*
@@ -155,7 +155,7 @@ public class Word {
try {
hashes.put(word2hash(word));
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return hashes;
}
return hashes;
@@ -167,7 +167,7 @@ public class Word {
try {
hashes.put(word2hash(word));
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return hashes;
}
return hashes;
diff --git a/source/net/yacy/kelondro/data/word/WordReferenceVars.java b/source/net/yacy/kelondro/data/word/WordReferenceVars.java
index 8fab41858..dbb49c0cb 100644
--- a/source/net/yacy/kelondro/data/word/WordReferenceVars.java
+++ b/source/net/yacy/kelondro/data/word/WordReferenceVars.java
@@ -37,10 +37,10 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.AbstractReference;
import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.rwi.ReferenceContainer;
@@ -508,7 +508,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
p--;
worker[p % cores0].add(this.container.get(p, false));
if (p % 100 == 0 && System.currentTimeMillis() > timeout) {
- Log.logWarning("TransformDistributor", "distribution of WordReference entries to worker queues ended with timeout = " + this.maxtime);
+ ConcurrentLog.warn("TransformDistributor", "distribution of WordReference entries to worker queues ended with timeout = " + this.maxtime);
break;
}
}
@@ -559,7 +559,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
while ((entry = this.in.take()) != WordReferenceRow.poisonRowEntry) {
this.out.put(new WordReferenceVars(new WordReferenceRow(entry), local));
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("TransformWorker", "normalization of row entries from row to vars ended with timeout = " + this.maxtime);
+ ConcurrentLog.warn("TransformWorker", "normalization of row entries from row to vars ended with timeout = " + this.maxtime);
break;
}
}
diff --git a/source/net/yacy/kelondro/index/BufferedObjectIndex.java b/source/net/yacy/kelondro/index/BufferedObjectIndex.java
index 3d9fc3884..ec0347eb8 100644
--- a/source/net/yacy/kelondro/index/BufferedObjectIndex.java
+++ b/source/net/yacy/kelondro/index/BufferedObjectIndex.java
@@ -34,9 +34,9 @@ import java.util.TreeMap;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Row.Entry;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MergeIterator;
/**
@@ -118,9 +118,9 @@ public class BufferedObjectIndex implements Index, Iterable<Row.Entry> {
try {
flushBuffer();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.backend.close();
}
@@ -283,7 +283,7 @@ public class BufferedObjectIndex implements Index, Iterable<Row.Entry> {
try {
return this.rows();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -336,7 +336,7 @@ public class BufferedObjectIndex implements Index, Iterable<Row.Entry> {
try {
this.buffer.put(this.backend.removeOne());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
break;
}
}
@@ -346,7 +346,7 @@ public class BufferedObjectIndex implements Index, Iterable<Row.Entry> {
try {
handles.put(i.next());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
break;
}
}
diff --git a/source/net/yacy/kelondro/index/RAMIndexCluster.java b/source/net/yacy/kelondro/index/RAMIndexCluster.java
index 95c4579e6..3a89793dd 100644
--- a/source/net/yacy/kelondro/index/RAMIndexCluster.java
+++ b/source/net/yacy/kelondro/index/RAMIndexCluster.java
@@ -34,9 +34,9 @@ import java.util.TreeMap;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Row.Entry;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MergeIterator;
import net.yacy.kelondro.util.StackIterator;
@@ -91,7 +91,7 @@ public final class RAMIndexCluster implements Index, Iterable<Row.Entry>, Clonea
for (final RAMIndex rs: this.cluster) try {
keysort.put(rs.smallestKey());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return keysort.smallestKey();
@@ -104,7 +104,7 @@ public final class RAMIndexCluster implements Index, Iterable<Row.Entry>, Clonea
for (final RAMIndex rs: this.cluster) try {
keysort.put(rs.largestKey());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return keysort.largestKey();
diff --git a/source/net/yacy/kelondro/index/Row.java b/source/net/yacy/kelondro/index/Row.java
index 79fef889d..1ca49b469 100644
--- a/source/net/yacy/kelondro/index/Row.java
+++ b/source/net/yacy/kelondro/index/Row.java
@@ -44,8 +44,8 @@ import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.order.Order;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.kelondroException;
@@ -173,7 +173,7 @@ public final class Row implements Serializable {
try {
assert (this.objectOrder.wellformed(rowinstance, start, this.primaryKeyLength)) : "rowinstance = " + UTF8.String(rowinstance);
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// this method offers the option to clone the content
// this is necessary if it is known that the underlying byte array may change and therefore
@@ -312,7 +312,7 @@ public final class Row implements Serializable {
try {
setCol(col.encoder, this.offset + clstrt, col.cellwidth, NumberTools.parseLongDecSubstring(token, p + 1));
} catch (final NumberFormatException e) {
- Log.logSevere("kelondroRow", "NumberFormatException for celltype_cardinal, celltype = " + col.celltype + ", encoder = " + col.encoder + ", value = '" + token.substring(p + 1).trim() + "'");
+ ConcurrentLog.severe("kelondroRow", "NumberFormatException for celltype_cardinal, celltype = " + col.celltype + ", encoder = " + col.encoder + ", value = '" + token.substring(p + 1).trim() + "'");
setCol(col.encoder, this.offset + clstrt, col.cellwidth, 0);
}
} else if ((decimalCardinal) && (col.celltype == Column.celltype_binary)) {
@@ -320,7 +320,7 @@ public final class Row implements Serializable {
try {
setCol(clstrt, col.cellwidth, new byte[]{(byte) NumberTools.parseIntDecSubstring(token, p + 1)});
} catch (final NumberFormatException e) {
- Log.logSevere("kelondroRow", "NumberFormatException for celltype_binary, celltype = " + col.celltype + ", encoder = " + col.encoder + ", value = '" + token.substring(p + 1).trim() + "'");
+ ConcurrentLog.severe("kelondroRow", "NumberFormatException for celltype_binary, celltype = " + col.celltype + ", encoder = " + col.encoder + ", value = '" + token.substring(p + 1).trim() + "'");
setCol(clstrt, col.cellwidth, new byte[]{0});
}
} else if ((decimalCardinal) && (col.celltype == Column.celltype_bitfield)) {
diff --git a/source/net/yacy/kelondro/index/RowCollection.java b/source/net/yacy/kelondro/index/RowCollection.java
index 065c641a0..056bc2b02 100644
--- a/source/net/yacy/kelondro/index/RowCollection.java
+++ b/source/net/yacy/kelondro/index/RowCollection.java
@@ -40,9 +40,9 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.sorting.Array;
import net.yacy.cora.sorting.Sortable;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Row.Entry;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.kelondroException;
@@ -106,7 +106,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
this.rowdef = rowdef;
this.chunkcount = (int) exportedCollection.getColLong(exp_chunkcount);
if ((this.chunkcount > chunkcachelength / rowdef.objectsize)) {
- Log.logWarning("RowCollection", "corrected wrong chunkcount; chunkcount = " + this.chunkcount + ", chunkcachelength = " + chunkcachelength + ", rowdef.objectsize = " + rowdef.objectsize);
+ ConcurrentLog.warn("RowCollection", "corrected wrong chunkcount; chunkcount = " + this.chunkcount + ", chunkcachelength = " + chunkcachelength + ", rowdef.objectsize = " + rowdef.objectsize);
this.chunkcount = chunkcachelength / rowdef.objectsize; // patch problem
}
this.lastTimeWrote = (exportedCollection.getColLong(exp_last_wrote) + 10957) * day;
@@ -122,7 +122,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
throw new kelondroException("old collection order does not match with new order; objectOrder.signature = " + rowdef.objectOrder.signature() + ", oldOrder.signature = " + oldOrder.signature());
this.sortBound = (int) exportedCollection.getColLong(exp_order_bound);
if (this.sortBound > this.chunkcount) {
- Log.logWarning("RowCollection", "corrected wrong sortBound; sortBound = " + this.sortBound + ", chunkcount = " + this.chunkcount);
+ ConcurrentLog.warn("RowCollection", "corrected wrong sortBound; sortBound = " + this.sortBound + ", chunkcount = " + this.chunkcount);
this.sortBound = this.chunkcount;
}
this.chunkcache = exportedCollection.getColBytes(exp_collection, false);
@@ -400,7 +400,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
private final void addUnique(final byte[] a, final int astart, final int alength) throws SpaceExceededException {
assert (a != null);
assert (astart >= 0) && (astart < a.length) : " astart = " + astart;
- assert (!(Log.allZero(a, astart, alength))) : "a = " + NaturalOrder.arrayList(a, astart, alength);
+ assert (!(ConcurrentLog.allZero(a, astart, alength))) : "a = " + NaturalOrder.arrayList(a, astart, alength);
assert (alength > 0);
assert (astart + alength <= a.length);
assert alength == this.rowdef.objectsize : "alength =" + alength + ", rowdef.objectsize = " + this.rowdef.objectsize;
@@ -424,7 +424,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
protected final void addSorted(final byte[] a, final int astart, final int alength) throws SpaceExceededException {
assert (a != null);
assert (astart >= 0) && (astart < a.length) : " astart = " + astart;
- assert (!(Log.allZero(a, astart, alength))) : "a = " + NaturalOrder.arrayList(a, astart, alength);
+ assert (!(ConcurrentLog.allZero(a, astart, alength))) : "a = " + NaturalOrder.arrayList(a, astart, alength);
assert (alength > 0);
assert (astart + alength <= a.length);
assert alength == this.rowdef.objectsize : "alength =" + alength + ", rowdef.objectsize = " + this.rowdef.objectsize;
@@ -827,7 +827,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
i--;
}
} catch (final RuntimeException e) {
- Log.logWarning("kelondroRowCollection", e.getMessage(), e);
+ ConcurrentLog.warn("kelondroRowCollection", e.getMessage(), e);
} finally {
if (!u) sort();
}
@@ -1063,7 +1063,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
//test(50000);
//test(100000);
//test(1000000);
- Log.shutdown();
+ ConcurrentLog.shutdown();
Array.terminate();
} catch (final SpaceExceededException e) {
e.printStackTrace();
diff --git a/source/net/yacy/kelondro/index/RowHandleMap.java b/source/net/yacy/kelondro/index/RowHandleMap.java
index 26accedb9..430a54e37 100644
--- a/source/net/yacy/kelondro/index/RowHandleMap.java
+++ b/source/net/yacy/kelondro/index/RowHandleMap.java
@@ -51,8 +51,8 @@ import java.util.zip.GZIPOutputStream;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.storage.HandleMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.workflow.WorkflowProcessor;
@@ -474,7 +474,7 @@ public final class RowHandleMap implements HandleMap, Iterable<Map.Entry<byte[],
}
}
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return this.map;
}
diff --git a/source/net/yacy/kelondro/index/RowHandleSet.java b/source/net/yacy/kelondro/index/RowHandleSet.java
index eb13e749b..c76c60a21 100644
--- a/source/net/yacy/kelondro/index/RowHandleSet.java
+++ b/source/net/yacy/kelondro/index/RowHandleSet.java
@@ -43,8 +43,8 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.SetTools;
@@ -63,7 +63,7 @@ public final class RowHandleSet implements HandleSet, Iterable<byte[]>, Cloneabl
try {
this.index = new RowSet(this.rowdef, 0);
} catch (SpaceExceededException ee) {
- Log.logException(ee);
+ ConcurrentLog.logException(ee);
this.index = null;
}
}
@@ -395,7 +395,7 @@ public final class RowHandleSet implements HandleSet, Iterable<byte[]>, Cloneabl
e.printStackTrace();
}
s.close();
- Log.shutdown();
+ ConcurrentLog.shutdown();
}
}
diff --git a/source/net/yacy/kelondro/index/RowSet.java b/source/net/yacy/kelondro/index/RowSet.java
index e47d80876..43b7e152a 100644
--- a/source/net/yacy/kelondro/index/RowSet.java
+++ b/source/net/yacy/kelondro/index/RowSet.java
@@ -39,8 +39,8 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MemoryControl;
@@ -102,7 +102,7 @@ public class RowSet extends RowCollection implements Index, Iterable<Row.Entry>,
}
//assert b.length - exportOverheadSize == size * rowdef.objectsize : "b.length = " + b.length + ", size * rowdef.objectsize = " + size * rowdef.objectsize;
if (b.length - exportOverheadSize != alloc) {
- Log.logSevere("RowSet", "exportOverheadSize wrong: b.length = " + b.length + ", size * rowdef.objectsize = " + size * rowdef.objectsize);
+ ConcurrentLog.severe("RowSet", "exportOverheadSize wrong: b.length = " + b.length + ", size * rowdef.objectsize = " + size * rowdef.objectsize);
return new RowSet(rowdef, 0);
}
System.arraycopy(b, (int) exportOverheadSize, chunkcache, 0, chunkcache.length);
@@ -505,13 +505,13 @@ public class RowSet extends RowCollection implements Index, Iterable<Row.Entry>,
try {
c0.sort();
} catch (final Throwable e) {
- Log.logSevere("RowSet", "collection corrupted. cleaned. " + e.getMessage(), e);
+ ConcurrentLog.severe("RowSet", "collection corrupted. cleaned. " + e.getMessage(), e);
c0.clear();
}
try {
c1.sort();
} catch (final Throwable e) {
- Log.logSevere("RowSet", "collection corrupted. cleaned. " + e.getMessage(), e);
+ ConcurrentLog.severe("RowSet", "collection corrupted. cleaned. " + e.getMessage(), e);
c1.clear();
}
int c0i = 0, c1i = 0;
diff --git a/source/net/yacy/kelondro/io/BufferedRecords.java b/source/net/yacy/kelondro/io/BufferedRecords.java
index daaa97dc5..c98e2b417 100644
--- a/source/net/yacy/kelondro/io/BufferedRecords.java
+++ b/source/net/yacy/kelondro/io/BufferedRecords.java
@@ -30,7 +30,7 @@ import java.util.Map;
import java.util.TreeMap;
import net.yacy.cora.document.UTF8;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
@@ -83,7 +83,7 @@ public final class BufferedRecords {
try {
flushBuffer0();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (this.efs != null) this.efs.close();
}
@@ -194,7 +194,7 @@ public final class BufferedRecords {
t.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/kelondro/io/ByteCountInputStream.java b/source/net/yacy/kelondro/io/ByteCountInputStream.java
index 89629d7ef..9305cfd40 100644
--- a/source/net/yacy/kelondro/io/ByteCountInputStream.java
+++ b/source/net/yacy/kelondro/io/ByteCountInputStream.java
@@ -30,7 +30,7 @@ import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public final class ByteCountInputStream extends FilterInputStream {
@@ -124,7 +124,7 @@ public final class ByteCountInputStream extends FilterInputStream {
try {
super.close();
} catch (OutOfMemoryError e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.finish();
}
diff --git a/source/net/yacy/kelondro/io/CachedFileReader.java b/source/net/yacy/kelondro/io/CachedFileReader.java
index f0d72fd87..487829525 100644
--- a/source/net/yacy/kelondro/io/CachedFileReader.java
+++ b/source/net/yacy/kelondro/io/CachedFileReader.java
@@ -25,7 +25,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
@@ -79,7 +79,7 @@ public final class CachedFileReader extends AbstractReader implements Reader {
try{RAFile.getChannel().close();} catch (IOException e) {}
RAFile.close();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.cache = null;
}
diff --git a/source/net/yacy/kelondro/io/CachedFileWriter.java b/source/net/yacy/kelondro/io/CachedFileWriter.java
index 292fa92f4..b2bff3858 100644
--- a/source/net/yacy/kelondro/io/CachedFileWriter.java
+++ b/source/net/yacy/kelondro/io/CachedFileWriter.java
@@ -30,7 +30,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public final class CachedFileWriter extends AbstractWriter implements Writer {
@@ -151,7 +151,7 @@ public final class CachedFileWriter extends AbstractWriter implements Writer {
this.RAFile.close();
//System.out.println("***DEBUG*** closed file " + this.file + ", FD is " + ((RAFile.getFD().valid()) ? "VALID" : "VOID") + ", channel is " + ((RAFile.getChannel().isOpen()) ? "OPEN" : "CLOSE"));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.cache = null;
this.RAFile = null;
@@ -163,7 +163,7 @@ public final class CachedFileWriter extends AbstractWriter implements Writer {
try {
this.RAFile = new RandomAccessFile(this.file, "rw");
} catch (FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.cache = new byte[8192];
this.cachestart = 0;
diff --git a/source/net/yacy/kelondro/io/CachedRecords.java b/source/net/yacy/kelondro/io/CachedRecords.java
index 5788aa602..70366d0a0 100644
--- a/source/net/yacy/kelondro/io/CachedRecords.java
+++ b/source/net/yacy/kelondro/io/CachedRecords.java
@@ -31,7 +31,7 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import net.yacy.cora.document.UTF8;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -94,7 +94,7 @@ public final class CachedRecords {
fos = new FileOutputStream(tablefile);
} catch (final FileNotFoundException e) {
// should not happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try { if (fos != null) fos.close(); } catch (final IOException e) {}
}
@@ -104,7 +104,7 @@ public final class CachedRecords {
this.raf = new RandomAccessFile(tablefile,"rw");
} catch (final FileNotFoundException e) {
// should never happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// initialize cache and buffer
@@ -241,7 +241,7 @@ public final class CachedRecords {
this.raf.seek(this.raf.length());
this.raf.write(this.buffer, 0, this.recordsize * this.buffercount);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.buffercount = 0;
}
@@ -253,7 +253,7 @@ public final class CachedRecords {
if (this.raf != null) try {
this.raf.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.raf = null;
this.buffer = null;
@@ -580,7 +580,7 @@ public final class CachedRecords {
t.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/io/Records.java b/source/net/yacy/kelondro/io/Records.java
index 3f09ba3e7..0a407eb67 100644
--- a/source/net/yacy/kelondro/io/Records.java
+++ b/source/net/yacy/kelondro/io/Records.java
@@ -31,7 +31,7 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import net.yacy.cora.document.UTF8;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -90,7 +90,7 @@ public final class Records {
fos = new FileOutputStream(tablefile);
} catch (final FileNotFoundException e) {
// should not happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try { if (fos != null) fos.close(); } catch (final IOException e) {}
}
@@ -100,7 +100,7 @@ public final class Records {
this.raf = new RandomAccessFile(tablefile,"rw");
} catch (final FileNotFoundException e) {
// should never happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// initialize write buffer
@@ -163,7 +163,7 @@ public final class Records {
records = this.raf.length() / this.recordsize;
} catch (NullPointerException e) {
// This may happen on shutdown while still something is moving on
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return records;
@@ -192,7 +192,7 @@ public final class Records {
this.raf.seek(this.raf.length());
this.raf.write(this.buffer, 0, this.recordsize * this.buffercount);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.buffercount = 0;
}
@@ -203,7 +203,7 @@ public final class Records {
flushBuffer();
this.raf.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.raf = null;
this.buffer = null;
@@ -477,7 +477,7 @@ public final class Records {
t.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/logging/ConsoleOutErrHandler.java b/source/net/yacy/kelondro/logging/ConsoleOutErrHandler.java
index 10bfb3932..2502c3553 100644
--- a/source/net/yacy/kelondro/logging/ConsoleOutErrHandler.java
+++ b/source/net/yacy/kelondro/logging/ConsoleOutErrHandler.java
@@ -37,6 +37,8 @@ import java.util.logging.LogManager;
import java.util.logging.LogRecord;
import java.util.logging.SimpleFormatter;
+import net.yacy.cora.util.ConcurrentLog;
+
public final class ConsoleOutErrHandler extends Handler {
private boolean ignoreCtrlChr = false;
@@ -78,7 +80,7 @@ public final class ConsoleOutErrHandler extends Handler {
this.stdOutHandler.setEncoding(encoding);
this.stdErrHandler.setEncoding(encoding);
} catch (final UnsupportedEncodingException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
final String ignoreCtrlChrStr = manager.getProperty(className + ".ignoreCtrlChr");
diff --git a/source/net/yacy/kelondro/logging/SimpleLogFormatter.java b/source/net/yacy/kelondro/logging/SimpleLogFormatter.java
index 3fa4ac75d..4022ba147 100644
--- a/source/net/yacy/kelondro/logging/SimpleLogFormatter.java
+++ b/source/net/yacy/kelondro/logging/SimpleLogFormatter.java
@@ -33,12 +33,35 @@ import java.text.FieldPosition;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
+import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.SimpleFormatter;
+import net.yacy.cora.util.ConcurrentLog;
+
public final class SimpleLogFormatter extends SimpleFormatter {
+ // log-level categories
+ public static final int LOGLEVEL_ZERO = Level.OFF.intValue(); // no output at all
+ public static final int LOGLEVEL_SEVERE = Level.SEVERE.intValue(); // system-level error, internal cause, critical and not fixeable (i.e. inconsistency)
+ public static final int LOGLEVEL_WARNING = Level.WARNING.intValue(); // uncritical service failure, may require user activity (i.e. input required, wrong authorization)
+ public static final int LOGLEVEL_CONFIG = Level.CONFIG.intValue(); // regular system status information (i.e. start-up messages)
+ public static final int LOGLEVEL_INFO = Level.INFO.intValue(); // regular action information (i.e. any httpd request URL)
+ public static final int LOGLEVEL_FINE = Level.FINE.intValue(); // in-function status debug output
+ public static final int LOGLEVEL_FINER = Level.FINER.intValue(); // in-function status debug output
+ public static final int LOGLEVEL_FINEST = Level.FINEST.intValue(); // in-function status debug output
+
+ // these categories are also present as character tokens
+ public static final char LOGTOKEN_ZERO = 'Z';
+ public static final char LOGTOKEN_SEVERE = 'E';
+ public static final char LOGTOKEN_WARNING = 'W';
+ public static final char LOGTOKEN_CONFIG = 'S';
+ public static final char LOGTOKEN_INFO = 'I';
+ public static final char LOGTOKEN_FINE = 'D';
+ public static final char LOGTOKEN_FINER = 'D';
+ public static final char LOGTOKEN_FINEST = 'D';
+
private final Date date = new Date();
private final FieldPosition position = new FieldPosition(0);
@@ -59,22 +82,22 @@ public final class SimpleLogFormatter extends SimpleFormatter {
// adding the loglevel
final int logLevel = record.getLevel().intValue();
- if (logLevel == Log.LOGLEVEL_SEVERE)
- this.buffer.append(Log.LOGTOKEN_SEVERE);
- else if (logLevel == Log.LOGLEVEL_WARNING)
- this.buffer.append(Log.LOGTOKEN_WARNING);
- else if (logLevel == Log.LOGLEVEL_CONFIG)
- this.buffer.append(Log.LOGTOKEN_CONFIG);
- else if (logLevel == Log.LOGLEVEL_INFO)
- this.buffer.append(Log.LOGTOKEN_INFO);
- else if (logLevel == Log.LOGLEVEL_FINE)
- this.buffer.append(Log.LOGTOKEN_FINE);
- else if (logLevel == Log.LOGLEVEL_FINER)
- this.buffer.append(Log.LOGTOKEN_FINER);
- else if (logLevel == Log.LOGLEVEL_FINEST)
- this.buffer.append(Log.LOGTOKEN_FINEST);
+ if (logLevel == LOGLEVEL_SEVERE)
+ this.buffer.append(LOGTOKEN_SEVERE);
+ else if (logLevel == LOGLEVEL_WARNING)
+ this.buffer.append(LOGTOKEN_WARNING);
+ else if (logLevel == LOGLEVEL_CONFIG)
+ this.buffer.append(LOGTOKEN_CONFIG);
+ else if (logLevel == LOGLEVEL_INFO)
+ this.buffer.append(LOGTOKEN_INFO);
+ else if (logLevel == LOGLEVEL_FINE)
+ this.buffer.append(LOGTOKEN_FINE);
+ else if (logLevel == LOGLEVEL_FINER)
+ this.buffer.append(LOGTOKEN_FINER);
+ else if (logLevel == LOGLEVEL_FINEST)
+ this.buffer.append(LOGTOKEN_FINEST);
else
- this.buffer.append(Log.LOGTOKEN_FINE);
+ this.buffer.append(LOGTOKEN_FINE);
this.buffer.append(' ');
// adding the logging date
diff --git a/source/net/yacy/kelondro/rwi/AbstractIndex.java b/source/net/yacy/kelondro/rwi/AbstractIndex.java
index 1ef06d35d..412c32926 100644
--- a/source/net/yacy/kelondro/rwi/AbstractIndex.java
+++ b/source/net/yacy/kelondro/rwi/AbstractIndex.java
@@ -33,9 +33,9 @@ import java.util.TreeMap;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
public abstract class AbstractIndex <ReferenceType extends Reference> implements Index<ReferenceType> {
@@ -115,7 +115,7 @@ public abstract class AbstractIndex <ReferenceType extends Reference> implements
try {
singleContainer = get(singleHash, urlselection);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
diff --git a/source/net/yacy/kelondro/rwi/IODispatcher.java b/source/net/yacy/kelondro/rwi/IODispatcher.java
index d3e925a07..15ad23d97 100644
--- a/source/net/yacy/kelondro/rwi/IODispatcher.java
+++ b/source/net/yacy/kelondro/rwi/IODispatcher.java
@@ -29,8 +29,8 @@ import java.io.IOException;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Semaphore;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.blob.ArrayStack;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MemoryControl;
@@ -48,7 +48,7 @@ import net.yacy.kelondro.util.MemoryControl;
*/
public class IODispatcher extends Thread {
- private static final Log log = new Log("IODispatcher");
+ private static final ConcurrentLog log = new ConcurrentLog("IODispatcher");
private Semaphore controlQueue;
private final Semaphore termination;
@@ -75,7 +75,7 @@ public class IODispatcher extends Thread {
try {
this.termination.acquire();
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -83,7 +83,7 @@ public class IODispatcher extends Thread {
@SuppressWarnings("unchecked")
protected synchronized void dump(final ReferenceContainerCache<? extends Reference> cache, final File file, final ReferenceContainerArray<? extends Reference> array) {
if (this.dumpQueue == null || this.controlQueue == null || !isAlive()) {
- log.logWarning("emergency dump of file " + file.getName());
+ log.warn("emergency dump of file " + file.getName());
if (!cache.isEmpty()) cache.dump(file, (int) Math.min(MemoryControl.available() / 3, this.writeBufferSize), true);
} else {
@SuppressWarnings("rawtypes")
@@ -93,16 +93,16 @@ public class IODispatcher extends Thread {
if (isAlive()) {
try {
this.dumpQueue.put(job);
- log.logInfo("appended dump job for file " + file.getName());
+ log.info("appended dump job for file " + file.getName());
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
cache.dump(file, (int) Math.min(MemoryControl.available() / 3, this.writeBufferSize), true);
} finally {
this.controlQueue.release();
}
} else {
job.dump();
- log.logWarning("dispatcher is not alive, just dumped file " + file.getName());
+ log.warn("dispatcher is not alive, just dumped file " + file.getName());
}
}
}
@@ -114,9 +114,9 @@ public class IODispatcher extends Thread {
protected synchronized void merge(final File f1, final File f2, final ReferenceFactory<? extends Reference> factory, final ArrayStack array, final File newFile) {
if (this.mergeQueue == null || this.controlQueue == null || !isAlive()) {
if (f2 == null) {
- log.logWarning("emergency rewrite of file " + f1.getName() + " to " + newFile.getName());
+ log.warn("emergency rewrite of file " + f1.getName() + " to " + newFile.getName());
} else {
- log.logWarning("emergency merge of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
+ log.warn("emergency merge of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
}
array.mergeMount(f1, f2, factory, newFile, (int) Math.min(MemoryControl.available() / 3, this.writeBufferSize));
} else {
@@ -125,12 +125,12 @@ public class IODispatcher extends Thread {
try {
this.mergeQueue.put(job);
if (f2 == null) {
- log.logInfo("appended rewrite job of file " + f1.getName() + " to " + newFile.getName());
+ log.info("appended rewrite job of file " + f1.getName() + " to " + newFile.getName());
} else {
- log.logInfo("appended merge job of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
+ log.info("appended merge job of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
}
} catch (final InterruptedException e) {
- log.logWarning("interrupted: " + e.getMessage(), e);
+ log.warn("interrupted: " + e.getMessage(), e);
array.mergeMount(f1, f2, factory, newFile, (int) Math.min(MemoryControl.available() / 3, this.writeBufferSize));
} finally {
this.controlQueue.release();
@@ -138,9 +138,9 @@ public class IODispatcher extends Thread {
} else {
job.merge();
if (f2 == null) {
- log.logWarning("dispatcher not running, merged files " + f1.getName() + " to " + newFile.getName());
+ log.warn("dispatcher not running, merged files " + f1.getName() + " to " + newFile.getName());
} else {
- log.logWarning("dispatcher not running, rewrote file " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
+ log.warn("dispatcher not running, rewrote file " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
}
}
}
@@ -162,11 +162,11 @@ public class IODispatcher extends Thread {
f = dumpJob.file;
dumpJob.dump();
} catch (final InterruptedException e) {
- log.logSevere("main run job was interrupted (1)", e);
- Log.logException(e);
+ log.severe("main run job was interrupted (1)", e);
+ ConcurrentLog.logException(e);
} catch (final Throwable e) {
- log.logSevere("main run job had errors (1), dump to " + f + " failed.", e);
- Log.logException(e);
+ log.severe("main run job had errors (1), dump to " + f + " failed.", e);
+ ConcurrentLog.logException(e);
}
continue loop;
}
@@ -181,37 +181,37 @@ public class IODispatcher extends Thread {
f2 = mergeJob.f2;
mergeJob.merge();
} catch (final InterruptedException e) {
- log.logSevere("main run job was interrupted (2)", e);
- Log.logException(e);
+ log.severe("main run job was interrupted (2)", e);
+ ConcurrentLog.logException(e);
} catch (final Throwable e) {
if (f2 == null) {
- log.logSevere("main run job had errors (2), dump to " + f + " failed. Input file is " + f1, e);
+ log.severe("main run job had errors (2), dump to " + f + " failed. Input file is " + f1, e);
} else {
- log.logSevere("main run job had errors (2), dump to " + f + " failed. Input files are " + f1 + " and " + f2, e);
+ log.severe("main run job had errors (2), dump to " + f + " failed. Input files are " + f1 + " and " + f2, e);
}
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
continue loop;
}
// check termination
if (this.terminate) {
- log.logInfo("caught termination signal");
+ log.info("caught termination signal");
break;
}
- log.logSevere("main loop in bad state, dumpQueue.size() = " + this.dumpQueue.size() + ", mergeQueue.size() = " + this.mergeQueue.size() + ", controlQueue.availablePermits() = " + this.controlQueue.availablePermits());
+ log.severe("main loop in bad state, dumpQueue.size() = " + this.dumpQueue.size() + ", mergeQueue.size() = " + this.mergeQueue.size() + ", controlQueue.availablePermits() = " + this.controlQueue.availablePermits());
assert false : "this process statt should not be reached"; // this should never happen
} catch (final Throwable e) {
- log.logSevere("main run job failed (X)", e);
- Log.logException(e);
+ log.severe("main run job failed (X)", e);
+ ConcurrentLog.logException(e);
}
- log.logInfo("loop terminated");
+ log.info("loop terminated");
} catch (final Throwable e) {
- log.logSevere("main run job failed (4)", e);
- Log.logException(e);
+ log.severe("main run job failed (4)", e);
+ ConcurrentLog.logException(e);
} finally {
- log.logInfo("terminating run job");
+ log.info("terminating run job");
this.controlQueue = null;
this.dumpQueue = null;
this.mergeQueue = null;
@@ -233,7 +233,7 @@ public class IODispatcher extends Thread {
if (!this.cache.isEmpty()) this.cache.dump(this.file, (int) Math.min(MemoryControl.available() / 3, IODispatcher.this.writeBufferSize), true);
this.array.mountBLOBFile(this.file);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -259,11 +259,11 @@ public class IODispatcher extends Thread {
private File merge() {
if (!this.f1.exists()) {
- log.logWarning("merge of file (1) " + this.f1.getName() + " failed: file does not exists");
+ log.warn("merge of file (1) " + this.f1.getName() + " failed: file does not exists");
return null;
}
if (this.f2 != null && !this.f2.exists()) {
- log.logWarning("merge of file (2) " + this.f2.getName() + " failed: file does not exists");
+ log.warn("merge of file (2) " + this.f2.getName() + " failed: file does not exists");
return null;
}
return this.array.mergeMount(this.f1, this.f2, this.factory, this.newFile, (int) Math.min(MemoryControl.available() / 3, IODispatcher.this.writeBufferSize));
diff --git a/source/net/yacy/kelondro/rwi/IndexCell.java b/source/net/yacy/kelondro/rwi/IndexCell.java
index ca61b9c91..78e54b7c2 100644
--- a/source/net/yacy/kelondro/rwi/IndexCell.java
+++ b/source/net/yacy/kelondro/rwi/IndexCell.java
@@ -38,10 +38,10 @@ import net.yacy.cora.order.Order;
import net.yacy.cora.sorting.Rating;
import net.yacy.cora.storage.ComparableARC;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.MergeIterator;
import net.yacy.search.EventTracker;
@@ -115,7 +115,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
try {
flushBuffer();
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try { Thread.sleep(3000); } catch (final InterruptedException e) {}
}
@@ -152,7 +152,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
IndexCell.this.lastDump = System.currentTimeMillis();
} catch (final Throwable e) {
// catch all exceptions
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -167,7 +167,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
IndexCell.this.lastCleanup = System.currentTimeMillis(); // set again to mark end of procedure
} catch (final Throwable e) {
// catch all exceptions
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -280,7 +280,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
try {
countFile = this.array.count(termHash);
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
assert countFile >= 0;
@@ -314,7 +314,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
try {
c1 = this.array.get(termHash);
} catch (final SpaceExceededException e2) {
- Log.logException(e2);
+ ConcurrentLog.logException(e2);
}
ReferenceContainer<ReferenceType> result = null;
if (c0 != null && c1 != null) {
@@ -355,7 +355,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
try {
c1 = this.array.get(termHash);
} catch (final SpaceExceededException e2) {
- Log.logException(e2);
+ ConcurrentLog.logException(e2);
}
if (c1 != null) {
this.array.delete(termHash);
@@ -383,7 +383,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
try {
c1 = this.array.get(termHash);
} catch (final SpaceExceededException e2) {
- Log.logException(e2);
+ ConcurrentLog.logException(e2);
}
if (c1 != null) {
this.array.delete(termHash);
@@ -445,7 +445,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
reduced = this.array.reduce(termHash, new RemoveReducer<ReferenceType>(urlHashes));
} catch (final SpaceExceededException e) {
reduced = 0;
- Log.logWarning("IndexCell", "not possible to remove urlHashes from a RWI because of too low memory. Remove was not applied. Please increase RAM assignment");
+ ConcurrentLog.warn("IndexCell", "not possible to remove urlHashes from a RWI because of too low memory. Remove was not applied. Please increase RAM assignment");
}
//assert this.array.mem() <= am : "am = " + am + ", array.mem() = " + this.array.mem();
return removed + (reduced / this.array.rowdef().objectsize);
@@ -461,7 +461,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
reduced = this.array.reduce(termHash, new RemoveReducer<ReferenceType>(urlHashBytes));
} catch (final SpaceExceededException e) {
reduced = 0;
- Log.logWarning("IndexCell", "not possible to remove urlHashes from a RWI because of too low memory. Remove was not applied. Please increase RAM assignment");
+ ConcurrentLog.warn("IndexCell", "not possible to remove urlHashes from a RWI because of too low memory. Remove was not applied. Please increase RAM assignment");
}
//assert this.array.mem() <= am : "am = " + am + ", array.mem() = " + this.array.mem();
return removed || (reduced > 0);
@@ -480,7 +480,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
try {
this.urlHashes.put(urlHashBytes);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainer.java b/source/net/yacy/kelondro/rwi/ReferenceContainer.java
index 46a6fdb4b..def34d070 100644
--- a/source/net/yacy/kelondro/rwi/ReferenceContainer.java
+++ b/source/net/yacy/kelondro/rwi/ReferenceContainer.java
@@ -39,10 +39,10 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.RowSet;
-import net.yacy.kelondro.logging.Log;
/**
@@ -160,7 +160,7 @@ public class ReferenceContainer<ReferenceType extends Reference> extends RowSet
try {
if (putRecent(i.next())) x++;
} catch (final ConcurrentModificationException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java b/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java
index 72b8a58ad..70b6def32 100644
--- a/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java
+++ b/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java
@@ -32,13 +32,13 @@ import java.util.Iterator;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.sorting.Rating;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.ArrayStack;
import net.yacy.kelondro.blob.BLOB;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.RowSet;
-import net.yacy.kelondro.logging.Log;
public final class ReferenceContainerArray<ReferenceType extends Reference> {
@@ -113,7 +113,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
try {
return new ReferenceContainerIterator(startWordHash, rot, excludePrivate);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -140,7 +140,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
try {
return new ReferenceContainerIterator((byte[]) secondWordHash, this.rot, this.excludePrivate);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -159,7 +159,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
if (this.excludePrivate && Word.isPrivate(b)) continue;
return get(b);
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
// rotation iteration
@@ -175,7 +175,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
}
return null;
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -206,7 +206,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
try {
return new ReferenceCountIterator(startWordHash, rot, excludePrivate);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -228,7 +228,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
try {
return new ReferenceCountIterator((byte[]) secondWordHash, this.rot, this.excludePrivate);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -248,7 +248,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
if (this.excludePrivate && Word.isPrivate(reference)) continue;
return new Rating<byte[]>(reference, count(reference));
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
// rotation iteration
@@ -261,7 +261,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
if (this.excludePrivate && Word.isPrivate(reference)) continue;
return new Rating<byte[]>(reference, count(reference));
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
return null;
@@ -310,14 +310,14 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
int k = 1;
ReferenceContainer<ReferenceType> c = new ReferenceContainer<ReferenceType>(this.factory, termHash, RowSet.importRowSet(a, this.factory.getRow()));
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("ReferenceContainerArray", "timout in get() (1): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
+ ConcurrentLog.warn("ReferenceContainerArray", "timout in get() (1): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
return c;
}
while (entries.hasNext()) {
c = c.merge(new ReferenceContainer<ReferenceType>(this.factory, termHash, RowSet.importRowSet(entries.next(), this.factory.getRow())));
k++;
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("ReferenceContainerArray", "timout in get() (2): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
+ ConcurrentLog.warn("ReferenceContainerArray", "timout in get() (2): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
return c;
}
}
@@ -333,7 +333,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
int c = RowSet.importRowCount(a, this.factory.getRow());
assert c >= 0;
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("ReferenceContainerArray", "timout in count() (1): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
+ ConcurrentLog.warn("ReferenceContainerArray", "timout in count() (1): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
return c;
}
while (entries.hasNext()) {
@@ -341,7 +341,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
assert c >= 0;
k++;
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("ReferenceContainerArray", "timout in count() (2): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
+ ConcurrentLog.warn("ReferenceContainerArray", "timout in count() (2): " + k + " tables searched. timeout = " + METHOD_MAXRUNTIME);
return c;
}
}
@@ -398,7 +398,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
public boolean shrinkBestSmallFiles(final IODispatcher merger, final long targetFileSize) {
final File[] ff = this.array.unmountBestMatch(2.0f, targetFileSize);
if (ff == null) return false;
- Log.logInfo("RICELL-shrink1", "unmountBestMatch(2.0, " + targetFileSize + ")");
+ ConcurrentLog.info("RICELL-shrink1", "unmountBestMatch(2.0, " + targetFileSize + ")");
merger.merge(ff[0], ff[1], this.factory, this.array, newContainerBLOBFile());
return true;
}
@@ -406,7 +406,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
public boolean shrinkAnySmallFiles(final IODispatcher merger, final long targetFileSize) {
final File[] ff = this.array.unmountSmallest(targetFileSize);
if (ff == null) return false;
- Log.logInfo("RICELL-shrink2", "unmountSmallest(" + targetFileSize + ")");
+ ConcurrentLog.info("RICELL-shrink2", "unmountSmallest(" + targetFileSize + ")");
merger.merge(ff[0], ff[1], this.factory, this.array, newContainerBLOBFile());
return true;
}
@@ -414,7 +414,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
public boolean shrinkUpToMaxSizeFiles(final IODispatcher merger, final long maxFileSize) {
final File[] ff = this.array.unmountBestMatch(2.0f, maxFileSize);
if (ff == null) return false;
- Log.logInfo("RICELL-shrink3", "unmountBestMatch(2.0, " + maxFileSize + ")");
+ ConcurrentLog.info("RICELL-shrink3", "unmountBestMatch(2.0, " + maxFileSize + ")");
merger.merge(ff[0], ff[1], this.factory, this.array, newContainerBLOBFile());
return true;
}
@@ -422,7 +422,7 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
public boolean shrinkOldFiles(final IODispatcher merger) {
final File ff = this.array.unmountOldest();
if (ff == null) return false;
- Log.logInfo("RICELL-shrink4/rewrite", "unmountOldest()");
+ ConcurrentLog.info("RICELL-shrink4/rewrite", "unmountOldest()");
merger.merge(ff, null, this.factory, this.array, newContainerBLOBFile());
return true;
}
diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java b/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java
index 93d207d01..1c8ba5ae4 100644
--- a/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java
+++ b/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java
@@ -40,11 +40,11 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.sorting.Rating;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.HeapWriter;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteArray;
import net.yacy.kelondro.util.FileUtils;
@@ -59,7 +59,7 @@ import net.yacy.kelondro.util.FileUtils;
*/
public final class ReferenceContainerCache<ReferenceType extends Reference> extends AbstractIndex<ReferenceType> implements Index<ReferenceType>, IndexReader<ReferenceType>, Iterable<ReferenceContainer<ReferenceType>> {
- private static final Log log = new Log("ReferenceContainerCache");
+ private static final ConcurrentLog log = new ConcurrentLog("ReferenceContainerCache");
private final int termSize;
private final ByteOrder termOrder;
@@ -119,14 +119,14 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
public void dump(final File heapFile, final int writeBuffer, final boolean destructive) {
assert this.cache != null;
if (this.cache == null) return;
- log.logInfo("creating rwi heap dump '" + heapFile.getName() + "', " + this.cache.size() + " rwi's");
+ log.info("creating rwi heap dump '" + heapFile.getName() + "', " + this.cache.size() + " rwi's");
if (heapFile.exists()) FileUtils.deletedelete(heapFile);
final File tmpFile = new File(heapFile.getParentFile(), heapFile.getName() + ".prt");
HeapWriter dump;
try {
dump = new HeapWriter(tmpFile, heapFile, this.termSize, this.termOrder, writeBuffer);
} catch (final IOException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
return;
}
final long startTime = System.currentTimeMillis();
@@ -153,9 +153,9 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
try {
dump.add(term, container.exportCollection());
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (destructive) container.clear(); // this memory is not needed any more
urlcount += container.size();
@@ -164,9 +164,9 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
}
try {
dump.close(true);
- log.logInfo("finished rwi heap dump: " + wordcount + " words, " + urlcount + " word/URL relations in " + (System.currentTimeMillis() - startTime) + " milliseconds");
+ log.info("finished rwi heap dump: " + wordcount + " words, " + urlcount + " word/URL relations in " + (System.currentTimeMillis() - startTime) + " milliseconds");
} catch (final IOException e) {
- log.logSevere("failed rwi heap dump: " + e.getMessage(), e);
+ log.severe("failed rwi heap dump: " + e.getMessage(), e);
} finally {
dump = null;
}
@@ -286,7 +286,7 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
try {
return c.topLevelClone();
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -303,7 +303,7 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
try {
return c.topLevelClone();
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -447,7 +447,7 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
}
return c1;
} catch (final SpaceExceededException e2) {
- Log.logException(e2);
+ ConcurrentLog.logException(e2);
}
return null;
}
diff --git a/source/net/yacy/kelondro/rwi/ReferenceIterator.java b/source/net/yacy/kelondro/rwi/ReferenceIterator.java
index 216f7fdf3..4ce6e0e7a 100644
--- a/source/net/yacy/kelondro/rwi/ReferenceIterator.java
+++ b/source/net/yacy/kelondro/rwi/ReferenceIterator.java
@@ -32,11 +32,11 @@ import java.util.Map;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.CloneableIterator;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.HeapReader;
import net.yacy.kelondro.index.RowSet;
-import net.yacy.kelondro.logging.Log;
/**
* iterator of BLOBHeap files: is used to import heap dumps into a write-enabled index heap
@@ -67,15 +67,15 @@ public class ReferenceIterator <ReferenceType extends Reference> extends LookAhe
try {
row = RowSet.importRowSet(entry.getValue(), this.factory.getRow());
if (row == null) {
- Log.logSevere("ReferenceIterator", "lost entry '" + UTF8.String(entry.getKey()) + "' because importRowSet returned null");
+ ConcurrentLog.severe("ReferenceIterator", "lost entry '" + UTF8.String(entry.getKey()) + "' because importRowSet returned null");
continue; // thats a fail but not as REALLY bad if the whole method would crash here
}
return new ReferenceContainer<ReferenceType>(this.factory, entry.getKey(), row);
} catch (final SpaceExceededException e) {
- Log.logSevere("ReferenceIterator", "lost entry '" + UTF8.String(entry.getKey()) + "' because of too low memory: " + e.toString());
+ ConcurrentLog.severe("ReferenceIterator", "lost entry '" + UTF8.String(entry.getKey()) + "' because of too low memory: " + e.toString());
continue;
} catch (final Throwable e) {
- Log.logSevere("ReferenceIterator", "lost entry '" + UTF8.String(entry.getKey()) + "' because of error: " + e.toString());
+ ConcurrentLog.severe("ReferenceIterator", "lost entry '" + UTF8.String(entry.getKey()) + "' because of error: " + e.toString());
continue;
}
}
@@ -95,7 +95,7 @@ public class ReferenceIterator <ReferenceType extends Reference> extends LookAhe
try {
return new ReferenceIterator<ReferenceType>(this.blobFile, this.factory);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/kelondro/table/ChunkIterator.java b/source/net/yacy/kelondro/table/ChunkIterator.java
index ad8e4591b..806d1bf17 100644
--- a/source/net/yacy/kelondro/table/ChunkIterator.java
+++ b/source/net/yacy/kelondro/table/ChunkIterator.java
@@ -33,8 +33,8 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
-import net.yacy.kelondro.logging.Log;
public class ChunkIterator extends LookAheadIterator<byte[]> implements Iterator<byte[]> {
@@ -82,7 +82,7 @@ public class ChunkIterator extends LookAheadIterator<byte[]> implements Iterator
// no real exception, this is the normal termination
return null;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
diff --git a/source/net/yacy/kelondro/table/Relations.java b/source/net/yacy/kelondro/table/Relations.java
index 7d75909bc..3a5d5ec2a 100644
--- a/source/net/yacy/kelondro/table/Relations.java
+++ b/source/net/yacy/kelondro/table/Relations.java
@@ -32,11 +32,11 @@ import java.util.HashMap;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
public class Relations {
@@ -192,9 +192,9 @@ public class Relations {
r.putRelation(table1, "abcdefg", "eineintrag");
r.putRelation(table1, "abcdefg", "eineintrag");
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/table/SQLTable.java b/source/net/yacy/kelondro/table/SQLTable.java
index c46897e7e..fa2f947ae 100644
--- a/source/net/yacy/kelondro/table/SQLTable.java
+++ b/source/net/yacy/kelondro/table/SQLTable.java
@@ -42,11 +42,11 @@ import java.util.TreeMap;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.CloneableIterator;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry;
import net.yacy.kelondro.index.RowCollection;
-import net.yacy.kelondro.logging.Log;
/*
@@ -129,7 +129,7 @@ public class SQLTable implements Index, Iterable<Row.Entry> {
if (this.theDBConnection != null) try {
this.theDBConnection.close();
} catch (final SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.theDBConnection = null;
}
@@ -152,7 +152,7 @@ public class SQLTable implements Index, Iterable<Row.Entry> {
return size;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return -1;
}
}
@@ -290,7 +290,7 @@ public class SQLTable implements Index, Iterable<Row.Entry> {
try {
sqlStatement.close();
} catch (final SQLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/kelondro/table/SplitTable.java b/source/net/yacy/kelondro/table/SplitTable.java
index fcd2f42ed..eff5f6215 100644
--- a/source/net/yacy/kelondro/table/SplitTable.java
+++ b/source/net/yacy/kelondro/table/SplitTable.java
@@ -43,6 +43,7 @@ import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.Order;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.ArrayStack;
import net.yacy.kelondro.index.Cache;
@@ -51,7 +52,6 @@ import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry;
import net.yacy.kelondro.index.RowCollection;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MergeIterator;
import net.yacy.kelondro.util.StackIterator;
@@ -120,7 +120,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
for (final Index oi: this.tables.values()) try {
keysort.put(oi.smallestKey());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return keysort.smallestKey();
}
@@ -131,7 +131,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
for (final Index oi: this.tables.values()) try {
keysort.put(oi.largestKey());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return keysort.largestKey();
}
@@ -175,7 +175,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
try {
d = GenericFormatter.SHORT_MILSEC_FORMATTER.parse(element.substring(this.prefix.length() + 1, this.prefix.length() + 18));
} catch (final ParseException e) {
- Log.logSevere("SplitTable", "", e);
+ ConcurrentLog.severe("SplitTable", "", e);
continue;
}
time = d.getTime();
@@ -212,7 +212,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
// open next biggest table
t.remove(maxf);
f = new File(this.path, maxf);
- Log.logInfo("kelondroSplitTable", "opening partial eco table " + f);
+ ConcurrentLog.info("kelondroSplitTable", "opening partial eco table " + f);
Table table;
try {
table = new Table(f, this.rowdef, EcoFSBufferSize, 0, this.useTailCache, this.exceed134217727, false);
@@ -220,7 +220,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
try {
table = new Table(f, this.rowdef, 0, 0, false, this.exceed134217727, false);
} catch (final SpaceExceededException ee) {
- Log.logSevere("SplitTable", "Table " + f.toString() + " cannot be initialized: " + ee.getMessage(), ee);
+ ConcurrentLog.severe("SplitTable", "Table " + f.toString() + " cannot be initialized: " + ee.getMessage(), ee);
continue maxfind;
}
}
@@ -349,7 +349,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
try {
table = new Table(f, this.rowdef, 0, 0, false, this.exceed134217727, true);
} catch (final SpaceExceededException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
this.tables.put(this.current, table);
@@ -368,7 +368,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
try {
d = GenericFormatter.SHORT_MILSEC_FORMATTER.parse(name.substring(this.prefix.length() + 1, this.prefix.length() + 18)).getTime();
} catch (final ParseException e) {
- Log.logSevere("SplitTable", "", e);
+ ConcurrentLog.severe("SplitTable", "", e);
d = 0;
}
if (d + this.fileAgeLimit < t || new File(this.path, name).length() >= this.fileSizeLimit) {
diff --git a/source/net/yacy/kelondro/table/Table.java b/source/net/yacy/kelondro/table/Table.java
index 703d5962b..7f1faaa22 100644
--- a/source/net/yacy/kelondro/table/Table.java
+++ b/source/net/yacy/kelondro/table/Table.java
@@ -42,6 +42,7 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.storage.HandleMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Column;
import net.yacy.kelondro.index.Index;
@@ -52,7 +53,6 @@ import net.yacy.kelondro.index.RowHandleMap;
import net.yacy.kelondro.index.RowSet;
import net.yacy.kelondro.io.BufferedRecords;
import net.yacy.kelondro.io.Records;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.kelondroException;
@@ -112,7 +112,7 @@ public class Table implements Index, Iterable<Row.Entry> {
fos = new FileOutputStream(tablefile);
} catch (final FileNotFoundException e) {
// should not happen
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
}
if (fos != null) try { fos.close(); } catch (final IOException e) {}
}
@@ -136,22 +136,22 @@ public class Table implements Index, Iterable<Row.Entry> {
this.table = null;
}
- Log.logInfo("TABLE", "initialization of " + tablefile.getName() + ". table copy: " + ((this.table == null) ? "no" : "yes") + ", available RAM: " + (MemoryControl.available() / 1024L / 1024L) + "MB, needed: " + (neededRAM4table / 1024L / 1024L) + "MB, allocating space for " + records + " entries");
+ ConcurrentLog.info("TABLE", "initialization of " + tablefile.getName() + ". table copy: " + ((this.table == null) ? "no" : "yes") + ", available RAM: " + (MemoryControl.available() / 1024L / 1024L) + "MB, needed: " + (neededRAM4table / 1024L / 1024L) + "MB, allocating space for " + records + " entries");
final long neededRAM4index = 100L * 1024L * 1024L + records * (rowdef.primaryKeyLength + 4L) * 3L / 2L;
if (records > 0 && !MemoryControl.request(neededRAM4index, true)) {
// despite calculations seemed to show that there is enough memory for the table AND the index
// there is now not enough memory left for the index. So delete the table again to free the memory
// for the index
- Log.logSevere("TABLE", tablefile.getName() + ": not enough RAM (" + (MemoryControl.available() / 1024L / 1024L) + "MB) left for index, deleting allocated table space to enable index space allocation (needed: " + (neededRAM4index / 1024L / 1024L) + "MB)");
+ ConcurrentLog.severe("TABLE", tablefile.getName() + ": not enough RAM (" + (MemoryControl.available() / 1024L / 1024L) + "MB) left for index, deleting allocated table space to enable index space allocation (needed: " + (neededRAM4index / 1024L / 1024L) + "MB)");
this.table = null; System.gc();
- Log.logSevere("TABLE", tablefile.getName() + ": RAM after releasing the table: " + (MemoryControl.available() / 1024L / 1024L) + "MB");
+ ConcurrentLog.severe("TABLE", tablefile.getName() + ": RAM after releasing the table: " + (MemoryControl.available() / 1024L / 1024L) + "MB");
}
this.index = new RowHandleMap(rowdef.primaryKeyLength, rowdef.objectOrder, 4, records, tablefile.getAbsolutePath());
final RowHandleMap errors = new RowHandleMap(rowdef.primaryKeyLength, NaturalOrder.naturalOrder, 4, records, tablefile.getAbsolutePath() + ".errors");
- Log.logInfo("TABLE", tablefile + ": TABLE " + tablefile.toString() + " has table copy " + ((this.table == null) ? "DISABLED" : "ENABLED"));
+ ConcurrentLog.info("TABLE", tablefile + ": TABLE " + tablefile.toString() + " has table copy " + ((this.table == null) ? "DISABLED" : "ENABLED"));
// read all elements from the file into the copy table
- Log.logInfo("TABLE", "initializing RAM index for TABLE " + tablefile.getName() + ", please wait.");
+ ConcurrentLog.info("TABLE", "initializing RAM index for TABLE " + tablefile.getName() + ", please wait.");
int i = 0;
byte[] key;
if (this.table == null) {
@@ -211,7 +211,7 @@ public class Table implements Index, Iterable<Row.Entry> {
removeInFile(idx);
key = entry.getKey();
if (key == null) continue;
- Log.logWarning("Table", "removing not well-formed entry " + idx + " with key: " + NaturalOrder.arrayList(key, 0, key.length) + ", " + errorcc++ + "/" + errorc);
+ ConcurrentLog.warn("Table", "removing not well-formed entry " + idx + " with key: " + NaturalOrder.arrayList(key, 0, key.length) + ", " + errorcc++ + "/" + errorc);
}
errors.close();
assert this.file.size() == this.index.size() : "file.size() = " + this.file.size() + ", index.size() = " + this.index.size() + ", file = " + filename();
@@ -220,10 +220,10 @@ public class Table implements Index, Iterable<Row.Entry> {
if (!freshFile && warmUp) {warmUp0();}
} catch (final FileNotFoundException e) {
// should never happen
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
throw new kelondroException(e.getMessage());
} catch (final IOException e) {
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
throw new kelondroException(e.getMessage());
}
@@ -242,7 +242,7 @@ public class Table implements Index, Iterable<Row.Entry> {
//assert index.size() + doubles.size() == i;
//System.out.println(" -removed " + doubles.size() + " doubles- done.");
if (doubles.isEmpty()) return;
- Log.logInfo("TABLE", filename() + ": WARNING - TABLE " + filename() + " has " + doubles.size() + " doubles");
+ ConcurrentLog.info("TABLE", filename() + ": WARNING - TABLE " + filename() + " has " + doubles.size() + " doubles");
// from all the doubles take one, put it back to the index and remove the others from the file
// first put back one element each
final byte[] record = new byte[this.rowdef.objectsize];
@@ -266,9 +266,9 @@ public class Table implements Index, Iterable<Row.Entry> {
removeInFile(top.intValue());
}
} catch (final SpaceExceededException e) {
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
} catch (final IOException e) {
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
}
}
@@ -297,16 +297,16 @@ public class Table implements Index, Iterable<Row.Entry> {
return Records.tableSize(tablefile, recordsize);
} catch (final IOException e) {
if (!fixIfCorrupted) {
- Log.logSevere("Table", "table size broken for file " + tablefile.toString(), e);
+ ConcurrentLog.severe("Table", "table size broken for file " + tablefile.toString(), e);
throw new kelondroException(e.getMessage());
}
- Log.logSevere("Table", "table size broken, try to fix " + tablefile.toString());
+ ConcurrentLog.severe("Table", "table size broken, try to fix " + tablefile.toString());
try {
Records.fixTableSize(tablefile, recordsize);
- Log.logInfo("Table", "successfully fixed table file " + tablefile.toString());
+ ConcurrentLog.info("Table", "successfully fixed table file " + tablefile.toString());
return Records.tableSize(tablefile, recordsize);
} catch (final IOException ee) {
- Log.logSevere("Table", "table size fix did not work", ee);
+ ConcurrentLog.severe("Table", "table size fix did not work", ee);
throw new kelondroException(e.getMessage());
}
}
@@ -356,7 +356,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
return this.file.size() == this.index.size();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
}
@@ -454,7 +454,7 @@ public class Table implements Index, Iterable<Row.Entry> {
d.remove(s);
removeInFile(s.intValue());
if (System.currentTimeMillis() - lastlog > 30000) {
- Log.logInfo("TABLE", "removing " + d.size() + " entries in " + filename());
+ ConcurrentLog.info("TABLE", "removing " + d.size() + " entries in " + filename());
lastlog = System.currentTimeMillis();
}
}
@@ -508,7 +508,7 @@ public class Table implements Index, Iterable<Row.Entry> {
this.file.get(i, b, 0);
} catch (final IndexOutOfBoundsException e) {
// there must be a problem with the table index
- Log.logSevere("Table", "IndexOutOfBoundsException: " + e.getMessage(), e);
+ ConcurrentLog.severe("Table", "IndexOutOfBoundsException: " + e.getMessage(), e);
this.index.remove(key);
if (this.table != null) this.table.remove(key);
return null;
@@ -697,7 +697,7 @@ public class Table implements Index, Iterable<Row.Entry> {
byte[] pk = lr.getPrimaryKeyBytes();
if (pk == null) {
// Table file might be corrupt
- Log.logWarning("TABLE", "Possible corruption found in table " + this.filename() + " detected. i=" + i + ",p=" + p);
+ ConcurrentLog.warn("TABLE", "Possible corruption found in table " + this.filename() + " detected. i=" + i + ",p=" + p);
continue;
}
this.index.put(pk, i);
@@ -752,7 +752,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
this.index.put(k, i);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new IOException("RowSpaceExceededException: " + e.getMessage());
}
}
@@ -782,7 +782,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
this.table.set(i, te);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.table = null;
}
@@ -881,7 +881,7 @@ public class Table implements Index, Iterable<Row.Entry> {
fos = new FileOutputStream(f);
} catch (final FileNotFoundException e) {
// should not happen
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
}
if (fos != null) try { fos.close(); } catch (final IOException e) {}
@@ -1021,7 +1021,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
Table.this.file.get(this.c, b, 0);
} catch (final IOException e) {
- Log.logSevere("Table", "", e);
+ ConcurrentLog.severe("Table", "", e);
return null;
}
} else {
@@ -1126,7 +1126,7 @@ public class Table implements Index, Iterable<Row.Entry> {
}
System.out.println("FINISHED test after " + ((System.currentTimeMillis() - start) / 1000) + " seconds.");
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
System.out.println("TERMINATED");
}
}
diff --git a/source/net/yacy/kelondro/util/ConsoleInterface.java b/source/net/yacy/kelondro/util/ConsoleInterface.java
index 0eb84aba4..d7d879926 100644
--- a/source/net/yacy/kelondro/util/ConsoleInterface.java
+++ b/source/net/yacy/kelondro/util/ConsoleInterface.java
@@ -32,17 +32,17 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Semaphore;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class ConsoleInterface extends Thread {
private final InputStream stream;
private final List<String> output = new ArrayList<String>();
private final Semaphore dataIsRead = new Semaphore(1);
- private final Log log;
+ private final ConcurrentLog log;
- private ConsoleInterface(final InputStream stream, final Log log) {
+ private ConsoleInterface(final InputStream stream, final ConcurrentLog log) {
this.log = log;
this.stream = stream;
// block reading {@see getOutput()}
@@ -50,7 +50,7 @@ public class ConsoleInterface extends Thread {
dataIsRead.acquire();
} catch (final InterruptedException e) {
// this should never happen because this is a constructor
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -78,9 +78,9 @@ public class ConsoleInterface extends Thread {
}
dataIsRead.release();
} catch (final IOException ix) {
- log.logWarning("logpoint 6 " + ix.getMessage());
+ log.warn("logpoint 6 " + ix.getMessage());
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -106,7 +106,7 @@ public class ConsoleInterface extends Thread {
* @return console output
* @throws IOException
*/
- private static List<String> getConsoleOutput(final List<String> processArgs, Log log) throws IOException {
+ private static List<String> getConsoleOutput(final List<String> processArgs, ConcurrentLog log) throws IOException {
final ProcessBuilder processBuilder = new ProcessBuilder(processArgs);
Process process = null;
ConsoleInterface inputStream = null;
@@ -124,22 +124,22 @@ public class ConsoleInterface extends Thread {
/*int retval =*/ process.waitFor();
} catch (final IOException iox) {
- log.logWarning("logpoint 0 " + iox.getMessage());
+ log.warn("logpoint 0 " + iox.getMessage());
throw new IOException(iox.getMessage());
} catch (final InterruptedException ix) {
- log.logWarning("logpoint 1 " + ix.getMessage());
+ log.warn("logpoint 1 " + ix.getMessage());
throw new IOException(ix.getMessage());
}
final List<String> list = inputStream.getOutput();
if (list.isEmpty()) {
final String error = errorStream.getOutput().toString();
- log.logWarning("logpoint 2: "+ error);
+ log.warn("logpoint 2: "+ error);
throw new IOException("empty list: " + error);
}
return list;
}
- public static String getLastLineConsoleOutput(final List<String> processArgs, Log log) throws IOException {
+ public static String getLastLineConsoleOutput(final List<String> processArgs, ConcurrentLog log) throws IOException {
List<String> lines = getConsoleOutput(processArgs, log);
String line = "";
for (int l = lines.size() - 1; l >= 0; l--) {
diff --git a/source/net/yacy/kelondro/util/FileUtils.java b/source/net/yacy/kelondro/util/FileUtils.java
index 32709e565..08dbf1672 100644
--- a/source/net/yacy/kelondro/util/FileUtils.java
+++ b/source/net/yacy/kelondro/util/FileUtils.java
@@ -55,7 +55,7 @@ import java.util.zip.GZIPInputStream;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.storage.Files;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public final class FileUtils {
@@ -182,7 +182,7 @@ public final class FileUtils {
try {
fos.close();
} catch ( final Exception e ) {
- Log.logWarning(
+ ConcurrentLog.warn(
"FileUtils",
"cannot close FileOutputStream for " + dest + "! " + e.getMessage());
}
@@ -383,7 +383,7 @@ public final class FileUtils {
final byte[] b = read(f);
return table(strings(b));
} catch ( final IOException e2 ) {
- Log.logSevere("FileUtils", f.toString() + " not found", e2);
+ ConcurrentLog.severe("FileUtils", f.toString() + " not found", e2);
return null;
}
}
@@ -427,9 +427,9 @@ public final class FileUtils {
}
pw.println("# EOF");
} catch ( FileNotFoundException e ) {
- Log.logWarning("FileUtils", e.getMessage(), e);
+ ConcurrentLog.warn("FileUtils", e.getMessage(), e);
} catch ( UnsupportedEncodingException e ) {
- Log.logWarning("FileUtils", e.getMessage(), e);
+ ConcurrentLog.warn("FileUtils", e.getMessage(), e);
} finally {
if ( pw != null ) {
pw.close();
@@ -476,7 +476,7 @@ public final class FileUtils {
//System.out.println("key = " + key + ", value = " + value);
props.put(key, value);
} catch (IndexOutOfBoundsException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return props;
@@ -730,7 +730,7 @@ public final class FileUtils {
} catch ( final IOException e ) {
this.nextLine = null;
} catch ( final OutOfMemoryError e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.nextLine = null;
}
if (this.nextLine == null && this.reader != null) {
@@ -829,7 +829,7 @@ public final class FileUtils {
try {
p = path.getCanonicalPath();
} catch ( final IOException e1 ) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
if ( System.getProperties().getProperty("os.name", "").toLowerCase().startsWith("windows") ) {
// deleting files on windows sometimes does not work with java
@@ -837,17 +837,17 @@ public final class FileUtils {
final String command = "cmd /C del /F /Q \"" + p + "\"";
final Process r = Runtime.getRuntime().exec(command);
if ( r == null ) {
- Log.logSevere("FileUtils", "cannot execute command: " + command);
+ ConcurrentLog.severe("FileUtils", "cannot execute command: " + command);
} else {
final byte[] response = read(r.getInputStream());
- Log.logInfo("FileUtils", "deletedelete: " + UTF8.String(response));
+ ConcurrentLog.info("FileUtils", "deletedelete: " + UTF8.String(response));
}
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
if ( path.exists() ) {
- Log.logSevere("FileUtils", "cannot delete file " + p);
+ ConcurrentLog.severe("FileUtils", "cannot delete file " + p);
}
}
}
diff --git a/source/net/yacy/kelondro/util/GenerationMemoryStrategy.java b/source/net/yacy/kelondro/util/GenerationMemoryStrategy.java
index 2c17ddf51..508897d94 100644
--- a/source/net/yacy/kelondro/util/GenerationMemoryStrategy.java
+++ b/source/net/yacy/kelondro/util/GenerationMemoryStrategy.java
@@ -41,7 +41,7 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
error = initPoolBeans();
heap = ManagementFactory.getMemoryMXBean();
if (lastGC == 0l) gc(10000, "initial gc - to get proper results"); // this is necessary on some GCs / vm
- if (error) log.logWarning(name + ": not a generational heap");
+ if (error) log.warn(name + ": not a generational heap");
}
/**
@@ -170,10 +170,10 @@ public class GenerationMemoryStrategy extends MemoryStrategy {
final MemoryUsage usage = bean.getCollectionUsage();
if (usage != null) return usage;
} catch (final IllegalArgumentException e) {
- log.logWarning(name + ": ", e);
+ log.warn(name + ": ", e);
}
error = true;
- log.logWarning(name + ": no colletion usage available at " + bean.getName());
+ log.warn(name + ": no colletion usage available at " + bean.getName());
}
return bean.getUsage();
}
diff --git a/source/net/yacy/kelondro/util/MemoryStrategy.java b/source/net/yacy/kelondro/util/MemoryStrategy.java
index e6d8a58bf..4d68b3863 100644
--- a/source/net/yacy/kelondro/util/MemoryStrategy.java
+++ b/source/net/yacy/kelondro/util/MemoryStrategy.java
@@ -25,11 +25,11 @@
package net.yacy.kelondro.util;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public abstract class MemoryStrategy {
- protected final static Log log = new Log("MEMORY");
+ protected final static ConcurrentLog log = new ConcurrentLog("MEMORY");
protected static long lastGC = 0l;
protected static boolean error = true;
protected static String name;
@@ -62,7 +62,7 @@ public abstract class MemoryStrategy {
return true;
}
- if (log.isFinest()) log.logFinest("[gc] no execute, last run: " + (elapsed / 1000) + " seconds ago, call: " + info);
+ if (log.isFinest()) log.finest("[gc] no execute, last run: " + (elapsed / 1000) + " seconds ago, call: " + info);
return false;
}
diff --git a/source/net/yacy/kelondro/util/MergeIterator.java b/source/net/yacy/kelondro/util/MergeIterator.java
index 70ad87ac8..492d4edf8 100644
--- a/source/net/yacy/kelondro/util/MergeIterator.java
+++ b/source/net/yacy/kelondro/util/MergeIterator.java
@@ -31,7 +31,7 @@ import java.util.Iterator;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.order.Order;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class MergeIterator<E> implements CloneableIterator<E> {
@@ -117,14 +117,14 @@ public class MergeIterator<E> implements CloneableIterator<E> {
s = (E) this.merger.invoke(null, new Object[]{this.na, this.nb});
//System.out.println("RESULT IS " + s.toString());
} catch (final IllegalArgumentException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
s = null;
} catch (final IllegalAccessException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
s = null;
} catch (final InvocationTargetException e) {
- Log.logException(e);
- Log.logException(e.getCause());
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e.getCause());
s = null;
}
nexta();
diff --git a/source/net/yacy/kelondro/util/OS.java b/source/net/yacy/kelondro/util/OS.java
index 09d82aae0..c600cd9c8 100644
--- a/source/net/yacy/kelondro/util/OS.java
+++ b/source/net/yacy/kelondro/util/OS.java
@@ -34,8 +34,8 @@ import java.util.Properties;
import java.util.Vector;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
-import net.yacy.kelondro.logging.Log;
import net.yacy.server.serverCore;
@@ -115,7 +115,7 @@ public final class OS {
processArgs.add("-Xms4m");
processArgs.add("-Xmx" + Integer.toString(mem) + "m");
try {
- line = ConsoleInterface.getLastLineConsoleOutput(processArgs, new Log("MEMCHECK"));
+ line = ConsoleInterface.getLastLineConsoleOutput(processArgs, new ConcurrentLog("MEMCHECK"));
} catch (final IOException e) {
return false;
}
@@ -157,7 +157,7 @@ public final class OS {
try {
Runtime.getRuntime().exec("chmod 755 " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ ")).waitFor();
} catch (final InterruptedException e) {
- Log.logSevere("DEPLOY", "deploy of script file failed. file = " + scriptFile.getAbsolutePath(), e);
+ ConcurrentLog.severe("DEPLOY", "deploy of script file failed. file = " + scriptFile.getAbsolutePath(), e);
throw new IOException(e.getMessage());
}
}
diff --git a/source/net/yacy/kelondro/util/SetTools.java b/source/net/yacy/kelondro/util/SetTools.java
index 7220a4d8c..42216904c 100644
--- a/source/net/yacy/kelondro/util/SetTools.java
+++ b/source/net/yacy/kelondro/util/SetTools.java
@@ -45,7 +45,7 @@ import java.util.TreeSet;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.storage.HandleSet;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public final class SetTools {
@@ -158,7 +158,7 @@ public final class SetTools {
}
}
} catch (ConcurrentModificationException e) {
- Log.logWarning("SetTools", e.getMessage(), e);
+ ConcurrentLog.warn("SetTools", e.getMessage(), e);
break loop;
}
}
diff --git a/source/net/yacy/kelondro/util/StandardMemoryStrategy.java b/source/net/yacy/kelondro/util/StandardMemoryStrategy.java
index a1883fa0c..39c70e168 100644
--- a/source/net/yacy/kelondro/util/StandardMemoryStrategy.java
+++ b/source/net/yacy/kelondro/util/StandardMemoryStrategy.java
@@ -61,14 +61,14 @@ public class StandardMemoryStrategy extends MemoryStrategy {
this.gcs[this.gcs_pos++] = after - before;
if (this.gcs_pos >= this.gcs.length) this.gcs_pos = 0;
- if (log.isFine()) log.logInfo("[gc] before: " + Formatter.bytesToString(before) +
+ if (log.isFine()) log.info("[gc] before: " + Formatter.bytesToString(before) +
", after: " + Formatter.bytesToString(after) +
", freed: " + Formatter.bytesToString(after - before) +
", rt: " + (lastGC - start) + " ms, call: " + info);
return true;
}
- if (log.isFinest()) log.logFinest("[gc] no execute, last run: " + (elapsed / 1000) + " seconds ago, call: " + info);
+ if (log.isFinest()) log.finest("[gc] no execute, last run: " + (elapsed / 1000) + " seconds ago, call: " + info);
return false;
}
@@ -159,7 +159,7 @@ public class StandardMemoryStrategy extends MemoryStrategy {
if (avail >= size) return true;
if (log.isFine()) {
final String t = new Throwable("Stack trace").getStackTrace()[1].toString();
- log.logFine(t + " requested " + (size >> 10) + " KB, got " + (avail >> 10) + " KB");
+ log.fine(t + " requested " + (size >> 10) + " KB, got " + (avail >> 10) + " KB");
}
if (force || avg == 0 || avg + avail >= size) {
// this is only called if we expect that an allocation of <size> bytes would cause the jvm to call the GC anyway
@@ -169,14 +169,14 @@ public class StandardMemoryStrategy extends MemoryStrategy {
avail = available();
if (performedGC) {
final long freed = avail - memBefore;
- log.logInfo("performed " + ((force) ? "explicit" : "necessary") + " GC, freed " + (freed >> 10)
+ log.info("performed " + ((force) ? "explicit" : "necessary") + " GC, freed " + (freed >> 10)
+ " KB (requested/available/average: "
+ (size >> 10) + " / " + (avail >> 10) + " / " + (avg >> 10) + " KB)");
}
checkProper(avail);
return avail >= size;
}
- if (log.isFine()) log.logFine("former GCs indicate to not be able to free enough memory (requested/available/average: "
+ if (log.isFine()) log.fine("former GCs indicate to not be able to free enough memory (requested/available/average: "
+ (size >> 10) + " / " + (avail >> 10) + " / " + (avg >> 10) + " KB)");
return false;
}
@@ -222,7 +222,7 @@ public class StandardMemoryStrategy extends MemoryStrategy {
this.prevTreshold = t;
- log.logInfo("checkProper: below treshold; tresholdCount: " + this.tresholdCount + "; proper: " + this.proper);
+ log.info("checkProper: below treshold; tresholdCount: " + this.tresholdCount + "; proper: " + this.proper);
}
else if (!this.proper && (available >> 20) > (this.properMbyte * 2L)) // we were wrong!
resetProperState();
diff --git a/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java b/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java
index a5beb7784..38e0a957c 100644
--- a/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java
+++ b/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java
@@ -24,13 +24,13 @@
package net.yacy.kelondro.workflow;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
public abstract class AbstractBlockingThread<J extends WorkflowJob> extends AbstractThread implements BlockingThread<J> {
private WorkflowProcessor<J> manager = null;
- private final static Log log = new Log("AbstractBlockingThread");
+ private final static ConcurrentLog log = new ConcurrentLog("AbstractBlockingThread");
@Override
public void setManager(final WorkflowProcessor<J> manager) {
@@ -96,7 +96,7 @@ public abstract class AbstractBlockingThread<J extends WorkflowJob> extends Abst
this.running = false;
break;
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
// handle exceptions: thread must not die on any unexpected exceptions
// if the exception is too bad it should call terminate()
this.jobExceptionHandler(e);
@@ -111,9 +111,9 @@ public abstract class AbstractBlockingThread<J extends WorkflowJob> extends Abst
private void logSystem(final String text) {
if (log == null) {
- Log.logConfig("THREAD-CONTROL", text);
+ ConcurrentLog.config("THREAD-CONTROL", text);
} else {
- log.logConfig(text);
+ log.config(text);
}
}
}
diff --git a/source/net/yacy/kelondro/workflow/AbstractBusyThread.java b/source/net/yacy/kelondro/workflow/AbstractBusyThread.java
index b5d90d85c..298afa0ad 100644
--- a/source/net/yacy/kelondro/workflow/AbstractBusyThread.java
+++ b/source/net/yacy/kelondro/workflow/AbstractBusyThread.java
@@ -27,13 +27,13 @@ package net.yacy.kelondro.workflow;
import java.net.SocketException;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
public abstract class AbstractBusyThread extends AbstractThread implements BusyThread {
- private final static Log log = new Log("BusyThread");
+ private final static ConcurrentLog log = new ConcurrentLog("BusyThread");
private long startup = 0, intermission = 0, idlePause = 0, busyPause = 0;
private long idletime = 0, memprereq = 0;
private long idleCycles = 0, busyCycles = 0, outofmemoryCycles = 0;
@@ -187,14 +187,14 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
idletime += System.currentTimeMillis() - timestamp;
} catch (final SocketException e) {
// in case that a socket is interrupted, this method must die silently (shutdown)
- log.logFine("socket-job interrupted: " + e.getMessage());
+ log.fine("socket-job interrupted: " + e.getMessage());
} catch (final Exception e) {
// handle exceptions: thread must not die on any unexpected exceptions
// if the exception is too bad it should call terminate()
this.jobExceptionHandler(e);
busyCycles++;
} else {
- log.logWarning("Thread '" + this.getName() + "' runs short memory cycle. Free mem: " +
+ log.warn("Thread '" + this.getName() + "' runs short memory cycle. Free mem: " +
(MemoryControl.available() / 1024) + " KB, needed: " + (memprereq / 1024) + " KB");
// omit job, not enough memory
// process scheduled pause
@@ -216,7 +216,7 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
Thread.sleep(millis);
} catch (final InterruptedException e) {
if (log != null)
- log.logConfig("thread '" + this.getName() + "' interrupted because of shutdown.");
+ log.config("thread '" + this.getName() + "' interrupted because of shutdown.");
}
}
@@ -224,7 +224,7 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
if (this.syncObject != null) {
synchronized (this.syncObject) {
if (log != null)
- if (log.isFine()) log.logFine("thread '" + this.getName()
+ if (log.isFine()) log.fine("thread '" + this.getName()
+ "' has received a notification from thread '"
+ Thread.currentThread().getName() + "'.");
this.syncObject.notifyAll();
@@ -233,7 +233,7 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
}
private void logSystem(final String text) {
- if (log == null) Log.logConfig("THREAD-CONTROL", text);
- else log.logConfig(text);
+ if (log == null) ConcurrentLog.config("THREAD-CONTROL", text);
+ else log.config(text);
}
}
diff --git a/source/net/yacy/kelondro/workflow/AbstractThread.java b/source/net/yacy/kelondro/workflow/AbstractThread.java
index 3fbd42de7..bea02e636 100644
--- a/source/net/yacy/kelondro/workflow/AbstractThread.java
+++ b/source/net/yacy/kelondro/workflow/AbstractThread.java
@@ -34,12 +34,12 @@ package net.yacy.kelondro.workflow;
import java.nio.channels.ClosedByInterruptException;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public abstract class AbstractThread extends Thread implements WorkflowThread {
- private static Log log = new Log("AbstractThread");
+ private static ConcurrentLog log = new ConcurrentLog("AbstractThread");
protected boolean running = true;
private boolean announcedShutdown = false;
protected long busytime = 0, memuse = 0;
@@ -128,9 +128,9 @@ public abstract class AbstractThread extends Thread implements WorkflowThread {
private final void logError(final String text,final Throwable thrown) {
if (log == null) {
- Log.logSevere("THREAD-CONTROL", text, thrown);
+ ConcurrentLog.severe("THREAD-CONTROL", text, thrown);
} else {
- log.logSevere(text,thrown);
+ log.severe(text,thrown);
}
}
diff --git a/source/net/yacy/kelondro/workflow/InstantBlockingThread.java b/source/net/yacy/kelondro/workflow/InstantBlockingThread.java
index a220a1cf9..a01b046b5 100644
--- a/source/net/yacy/kelondro/workflow/InstantBlockingThread.java
+++ b/source/net/yacy/kelondro/workflow/InstantBlockingThread.java
@@ -30,7 +30,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class InstantBlockingThread<J extends WorkflowJob> extends AbstractBlockingThread<J> implements BlockingThread<J> {
@@ -98,13 +98,13 @@ public class InstantBlockingThread<J extends WorkflowJob> extends AbstractBlocki
try {
out = (J) this.jobExecMethod.invoke(this.environment, new Object[]{next});
} catch (final Throwable e) {
- Log.logSevere(BLOCKINGTHREAD, "Internal Error in serverInstantThread.job: " + e.getMessage());
- Log.logSevere(BLOCKINGTHREAD, "shutting down thread '" + getName() + "'");
+ ConcurrentLog.severe(BLOCKINGTHREAD, "Internal Error in serverInstantThread.job: " + e.getMessage());
+ ConcurrentLog.severe(BLOCKINGTHREAD, "shutting down thread '" + getName() + "'");
final Throwable targetException = (e instanceof InvocationTargetException) ? ((InvocationTargetException) e).getTargetException() : null;
- Log.logException(e);
- Log.logException(e.getCause());
- if (targetException != null) Log.logException(targetException);
- Log.logSevere(BLOCKINGTHREAD, "Runtime Error in serverInstantThread.job, thread '" + getName() + "': " + e.getMessage());
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e.getCause());
+ if (targetException != null) ConcurrentLog.logException(targetException);
+ ConcurrentLog.severe(BLOCKINGTHREAD, "Runtime Error in serverInstantThread.job, thread '" + getName() + "': " + e.getMessage());
}
instantThreadCounter.decrementAndGet();
jobs.remove(this.handle);
diff --git a/source/net/yacy/kelondro/workflow/InstantBusyThread.java b/source/net/yacy/kelondro/workflow/InstantBusyThread.java
index 1b5565c51..e8c3df3c5 100644
--- a/source/net/yacy/kelondro/workflow/InstantBusyThread.java
+++ b/source/net/yacy/kelondro/workflow/InstantBusyThread.java
@@ -28,7 +28,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.TreeMap;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public final class InstantBusyThread extends AbstractBusyThread implements BusyThread {
@@ -93,7 +93,7 @@ public final class InstantBusyThread extends AbstractBusyThread implements BusyT
} catch (final IllegalArgumentException e) {
return -1;
} catch (final InvocationTargetException e) {
- Log.logSevere("BUSYTHREAD", "invocation serverInstantThread of thread '" + getName() + "': " + e.getMessage(), e);
+ ConcurrentLog.severe("BUSYTHREAD", "invocation serverInstantThread of thread '" + getName() + "': " + e.getMessage(), e);
return -1;
}
}
@@ -108,26 +108,26 @@ public final class InstantBusyThread extends AbstractBusyThread implements BusyT
if (result == null) jobHasDoneSomething = true;
else if (result instanceof Boolean) jobHasDoneSomething = ((Boolean) result).booleanValue();
} catch (final IllegalAccessException e) {
- Log.logSevere("BUSYTHREAD", "Internal Error in serverInstantThread.job: " + e.getMessage());
- Log.logSevere("BUSYTHREAD", "shutting down thread '" + getName() + "'");
+ ConcurrentLog.severe("BUSYTHREAD", "Internal Error in serverInstantThread.job: " + e.getMessage());
+ ConcurrentLog.severe("BUSYTHREAD", "shutting down thread '" + getName() + "'");
terminate(false);
} catch (final IllegalArgumentException e) {
- Log.logSevere("BUSYTHREAD", "Internal Error in serverInstantThread.job: " + e.getMessage());
- Log.logSevere("BUSYTHREAD", "shutting down thread '" + getName() + "'");
+ ConcurrentLog.severe("BUSYTHREAD", "Internal Error in serverInstantThread.job: " + e.getMessage());
+ ConcurrentLog.severe("BUSYTHREAD", "shutting down thread '" + getName() + "'");
terminate(false);
} catch (final InvocationTargetException e) {
final String targetException = e.getTargetException().getMessage();
- Log.logException(e);
- Log.logException(e.getCause());
- Log.logException(e.getTargetException());
- Log.logSevere("BUSYTHREAD", "Runtime Error in serverInstantThread.job, thread '" + getName() + "': " + e.getMessage() + "; target exception: " + targetException, e.getTargetException());
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e.getCause());
+ ConcurrentLog.logException(e.getTargetException());
+ ConcurrentLog.severe("BUSYTHREAD", "Runtime Error in serverInstantThread.job, thread '" + getName() + "': " + e.getMessage() + "; target exception: " + targetException, e.getTargetException());
} catch (final OutOfMemoryError e) {
- Log.logSevere("BUSYTHREAD", "OutOfMemory Error in serverInstantThread.job, thread '" + getName() + "': " + e.getMessage());
- Log.logException(e);
+ ConcurrentLog.severe("BUSYTHREAD", "OutOfMemory Error in serverInstantThread.job, thread '" + getName() + "': " + e.getMessage());
+ ConcurrentLog.logException(e);
freemem();
} catch (final Exception e) {
- Log.logSevere("BUSYTHREAD", "Generic Exception, thread '" + getName() + "': " + e.getMessage());
- Log.logException(e);
+ ConcurrentLog.severe("BUSYTHREAD", "Generic Exception, thread '" + getName() + "': " + e.getMessage());
+ ConcurrentLog.logException(e);
}
synchronized(jobs) {jobs.remove(this.handle);}
return jobHasDoneSomething;
@@ -139,21 +139,21 @@ public final class InstantBusyThread extends AbstractBusyThread implements BusyT
try {
this.freememExecMethod.invoke(this.environment);
} catch (final IllegalAccessException e) {
- Log.logSevere("BUSYTHREAD", "Internal Error in serverInstantThread.freemem: " + e.getMessage());
- Log.logSevere("BUSYTHREAD", "shutting down thread '" + getName() + "'");
+ ConcurrentLog.severe("BUSYTHREAD", "Internal Error in serverInstantThread.freemem: " + e.getMessage());
+ ConcurrentLog.severe("BUSYTHREAD", "shutting down thread '" + getName() + "'");
terminate(false);
} catch (final IllegalArgumentException e) {
- Log.logSevere("BUSYTHREAD", "Internal Error in serverInstantThread.freemem: " + e.getMessage());
- Log.logSevere("BUSYTHREAD", "shutting down thread '" + getName() + "'");
+ ConcurrentLog.severe("BUSYTHREAD", "Internal Error in serverInstantThread.freemem: " + e.getMessage());
+ ConcurrentLog.severe("BUSYTHREAD", "shutting down thread '" + getName() + "'");
terminate(false);
} catch (final InvocationTargetException e) {
final String targetException = e.getTargetException().getMessage();
- if (targetException.indexOf("heap space",0) > 0) Log.logException(e.getTargetException());
- Log.logSevere("BUSYTHREAD", "Runtime Error in serverInstantThread.freemem, thread '" + getName() + "': " + e.getMessage() + "; target exception: " + targetException, e.getTargetException());
- Log.logException(e.getTargetException());
+ if (targetException.indexOf("heap space",0) > 0) ConcurrentLog.logException(e.getTargetException());
+ ConcurrentLog.severe("BUSYTHREAD", "Runtime Error in serverInstantThread.freemem, thread '" + getName() + "': " + e.getMessage() + "; target exception: " + targetException, e.getTargetException());
+ ConcurrentLog.logException(e.getTargetException());
} catch (final OutOfMemoryError e) {
- Log.logSevere("BUSYTHREAD", "OutOfMemory Error in serverInstantThread.freemem, thread '" + getName() + "': " + e.getMessage());
- Log.logException(e);
+ ConcurrentLog.severe("BUSYTHREAD", "OutOfMemory Error in serverInstantThread.freemem, thread '" + getName() + "': " + e.getMessage());
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/kelondro/workflow/WorkflowProcessor.java b/source/net/yacy/kelondro/workflow/WorkflowProcessor.java
index 31c61b4a6..841950de4 100644
--- a/source/net/yacy/kelondro/workflow/WorkflowProcessor.java
+++ b/source/net/yacy/kelondro/workflow/WorkflowProcessor.java
@@ -33,7 +33,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.NamePrefixThreadFactory;
@@ -181,7 +181,7 @@ public class WorkflowProcessor<J extends WorkflowJob> {
this.output.enQueue(out);
}
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return;
}
@@ -215,16 +215,16 @@ public class WorkflowProcessor<J extends WorkflowJob> {
// put poison pills into the queue
for (int i = 0; i < this.executorRunning.get(); i++) {
try {
- Log.logInfo("serverProcessor", "putting poison pill in queue " + this.processName + ", thread " + i);
+ ConcurrentLog.info("serverProcessor", "putting poison pill in queue " + this.processName + ", thread " + i);
this.input.put((J) WorkflowJob.poisonPill); // put a poison pill into the queue which will kill the job
- Log.logInfo("serverProcessor", ".. poison pill is in queue " + this.processName + ", thread " + i + ". awaiting termination");
+ ConcurrentLog.info("serverProcessor", ".. poison pill is in queue " + this.processName + ", thread " + i + ". awaiting termination");
} catch (final InterruptedException e) { }
}
// wait until input queue is empty
for (int i = 0; i < 10; i++) {
if (this.input.size() <= 0) break;
- Log.logInfo("WorkflowProcess", "waiting for queue " + this.processName + " to shut down; input.size = " + this.input.size());
+ ConcurrentLog.info("WorkflowProcess", "waiting for queue " + this.processName + " to shut down; input.size = " + this.input.size());
try {Thread.sleep(1000);} catch (InterruptedException e) {}
}
this.executorRunning.set(0);
@@ -240,7 +240,7 @@ public class WorkflowProcessor<J extends WorkflowJob> {
}
} catch (final InterruptedException e) {}
}
- Log.logInfo("serverProcessor", "queue " + this.processName + ": shutdown.");
+ ConcurrentLog.info("serverProcessor", "queue " + this.processName + ": shutdown.");
this.executor = null;
this.input = null;
// remove entry from monitor
diff --git a/source/net/yacy/migration.java b/source/net/yacy/migration.java
index e41610cce..35668c7d6 100644
--- a/source/net/yacy/migration.java
+++ b/source/net/yacy/migration.java
@@ -31,13 +31,13 @@ import java.util.Set;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import com.google.common.io.Files;
import net.yacy.cora.storage.Configuration.Entry;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
@@ -64,7 +64,7 @@ public class migration {
if(fromRev < NEW_OVERLAYS){
migrateDefaultFiles(sb);
}
- Log.logInfo("MIGRATION", "Migrating from "+ fromRev + " to " + toRev);
+ ConcurrentLog.info("MIGRATION", "Migrating from "+ fromRev + " to " + toRev);
presetPasswords(sb);
migrateSwitchConfigSettings(sb);
migrateWorkFiles(sb);
@@ -124,17 +124,17 @@ public class migration {
final File styleFile=new File(htdocsPath, "style.css");
if(!skinFile.exists()){
if(styleFile.exists()){
- Log.logInfo("MIGRATION", "Skin "+skin+" not found. Keeping old skin.");
+ ConcurrentLog.info("MIGRATION", "Skin "+skin+" not found. Keeping old skin.");
}else{
- Log.logSevere("MIGRATION", "Skin "+skin+" and no existing Skin found.");
+ ConcurrentLog.severe("MIGRATION", "Skin "+skin+" and no existing Skin found.");
}
}else{
try {
mkdirs(styleFile.getParentFile());
Files.copy(skinFile, styleFile);
- Log.logInfo("MIGRATION", "copied new Skinfile");
+ ConcurrentLog.info("MIGRATION", "copied new Skinfile");
} catch (final IOException e) {
- Log.logSevere("MIGRATION", "Cannot copy skinfile.");
+ ConcurrentLog.severe("MIGRATION", "Cannot copy skinfile.");
}
}
}
@@ -145,7 +145,7 @@ public class migration {
private static void mkdirs(final File path) {
if (!path.exists()) {
if(!path.mkdirs())
- Log.logWarning("MIGRATION", "could not create directories for "+ path);
+ ConcurrentLog.warn("MIGRATION", "could not create directories for "+ path);
}
}
public static void migrateBookmarkTagsDB(final Switchboard sb){
@@ -153,12 +153,12 @@ public class migration {
final File tagsDBFile=new File(sb.workPath, "bookmarkTags.db");
if(tagsDBFile.exists()){
delete(tagsDBFile);
- Log.logInfo("MIGRATION", "Migrating bookmarkTags.db to use wordhashs as keys.");
+ ConcurrentLog.info("MIGRATION", "Migrating bookmarkTags.db to use wordhashs as keys.");
}
try {
sb.initBookmarks();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -167,13 +167,13 @@ public class migration {
*/
private static void delete(final File filename) {
if(!filename.delete())
- Log.logWarning("MIGRATION", "could not delete "+ filename);
+ ConcurrentLog.warn("MIGRATION", "could not delete "+ filename);
}
public static void migrateWorkFiles(final Switchboard sb){
File file=new File(sb.getDataPath(), "DATA/SETTINGS/wiki.db");
File file2;
if (file.exists()) {
- Log.logInfo("MIGRATION", "Migrating wiki.db to "+ sb.workPath);
+ ConcurrentLog.info("MIGRATION", "Migrating wiki.db to "+ sb.workPath);
sb.wikiDB.close();
file2 = new File(sb.workPath, "wiki.db");
try {
@@ -184,7 +184,7 @@ public class migration {
file = new File(sb.getDataPath(), "DATA/SETTINGS/wiki-bkp.db");
if (file.exists()) {
- Log.logInfo("MIGRATION", "Migrating wiki-bkp.db to "+ sb.workPath);
+ ConcurrentLog.info("MIGRATION", "Migrating wiki-bkp.db to "+ sb.workPath);
file2 = new File(sb.workPath, "wiki-bkp.db");
try {
Files.copy(file, file2);
@@ -194,14 +194,14 @@ public class migration {
try {
sb.initWiki();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
file=new File(sb.getDataPath(), "DATA/SETTINGS/message.db");
if(file.exists()){
- Log.logInfo("MIGRATION", "Migrating message.db to "+ sb.workPath);
+ ConcurrentLog.info("MIGRATION", "Migrating message.db to "+ sb.workPath);
sb.messageDB.close();
file2=new File(sb.workPath, "message.db");
try {
@@ -211,7 +211,7 @@ public class migration {
try {
sb.initMessages();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -289,7 +289,7 @@ public class migration {
try {
f.createNewFile();
} catch (IOException ex) {
- Log.logInfo("migrateUrldbtoSolr","could not create lock file");
+ ConcurrentLog.info("migrateUrldbtoSolr","could not create lock file");
}
final Thread t = new Thread() {
@@ -319,15 +319,15 @@ public class migration {
go = false;
}
} catch (Exception e) {
- Log.logInfo("migrateUrldbtoSolr", "some error while adding old data to new index, continue with next entry");
+ ConcurrentLog.info("migrateUrldbtoSolr", "some error while adding old data to new index, continue with next entry");
}
}
- Log.logInfo("migrateUrldbtoSolr", Integer.toString(i) + " entries left (convert next chunk of 1000 entries)");
+ ConcurrentLog.info("migrateUrldbtoSolr", Integer.toString(i) + " entries left (convert next chunk of 1000 entries)");
}
ft.commit(true);
} catch (IOException ex) {
- Log.logInfo("migrateUrldbtoSolr", "error reading old urldb index");
+ ConcurrentLog.info("migrateUrldbtoSolr", "error reading old urldb index");
} finally {
if (f.exists()) {
f.delete(); // delete lock file
@@ -382,9 +382,9 @@ public class migration {
}
lukeCheckok = true;
} catch (SolrServerException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
}
if (!lukeCheckok) { // if luke failed alternatively use config and manual list
diff --git a/source/net/yacy/peers/DHTSelection.java b/source/net/yacy/peers/DHTSelection.java
index 8c9b48821..1c6ad456c 100644
--- a/source/net/yacy/peers/DHTSelection.java
+++ b/source/net/yacy/peers/DHTSelection.java
@@ -39,10 +39,10 @@ import net.yacy.cora.federate.yacy.Distribution;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.kelondroException;
import net.yacy.peers.operation.yacyVersion;
@@ -127,12 +127,12 @@ public class DHTSelection {
if (seed == null) continue;
if (seed.isLastSeenTimeout(3600000)) continue;
if (seed.getAge() < 1) { // the 'workshop feature'
- Log.logInfo("DHT", "selectPeers/Age: " + seed.hash + ":" + seed.getName() + ", is newbie, age = " + seed.getAge());
+ ConcurrentLog.info("DHT", "selectPeers/Age: " + seed.hash + ":" + seed.getName() + ", is newbie, age = " + seed.getAge());
regularSeeds.put(seed.hash, seed);
continue;
}
if (Math.random() * 100 + (wordhashes.size() > 1 ? burstMultiwordPercent : 25) >= 50) {
- if (Log.isFine("DHT")) Log.logFine("DHT", "selectPeers/CountBurst: " + seed.hash + ":" + seed.getName() + ", RWIcount=" + seed.getWordCount());
+ if (ConcurrentLog.isFine("DHT")) ConcurrentLog.fine("DHT", "selectPeers/CountBurst: " + seed.hash + ":" + seed.getName() + ", RWIcount=" + seed.getWordCount());
regularSeeds.put(seed.hash, seed);
continue;
}
@@ -157,7 +157,7 @@ public class DHTSelection {
if (seed == null) continue;
if (seed.isLastSeenTimeout(3600000)) continue;
if (Math.random() * 100 + burstRobinsonPercent >= 100) {
- if (Log.isFine("DHT")) Log.logFine("DHT", "selectPeers/RobinsonBurst: " + seed.hash + ":" + seed.getName());
+ if (ConcurrentLog.isFine("DHT")) ConcurrentLog.fine("DHT", "selectPeers/RobinsonBurst: " + seed.hash + ":" + seed.getName());
regularSeeds.put(seed.hash, seed);
continue;
}
@@ -174,9 +174,9 @@ public class DHTSelection {
// peer tags match
String specialized = seed.getPeerTags().toString();
if (specialized.equals("[*]")) {
- Log.logInfo("DHT", "selectPeers/RobinsonTag: " + seed.hash + ":" + seed.getName() + " grants search for all");
+ ConcurrentLog.info("DHT", "selectPeers/RobinsonTag: " + seed.hash + ":" + seed.getName() + " grants search for all");
} else {
- Log.logInfo("DHT", "selectPeers/RobinsonTag " + seed.hash + ":" + seed.getName() + " is specialized peer for " + specialized);
+ ConcurrentLog.info("DHT", "selectPeers/RobinsonTag " + seed.hash + ":" + seed.getName() + " is specialized peer for " + specialized);
}
regularSeeds.put(seed.hash, seed);
}
@@ -205,7 +205,7 @@ public class DHTSelection {
seed = dhtEnum.next();
if (seed == null || seed.hash == null) continue;
if (!seed.getFlagAcceptRemoteIndex()) continue; // probably a robinson peer
- if (Log.isFine("DHT")) Log.logFine("DHT", "selectPeers/DHTorder: " + seed.hash + ":" + seed.getName() + "/ score " + c);
+ if (ConcurrentLog.isFine("DHT")) ConcurrentLog.fine("DHT", "selectPeers/DHTorder: " + seed.hash + ":" + seed.getName() + "/ score " + c);
regularSeeds.put(seed.hash, seed);
c--;
}
@@ -281,7 +281,7 @@ public class DHTSelection {
try {
this.doublecheck.put(hashb);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
break;
}
if (s.getFlagAcceptRemoteIndex() ||
@@ -293,7 +293,7 @@ public class DHTSelection {
}
} catch (final kelondroException e) {
System.out.println("DEBUG acceptRemoteIndexSeedEnum:" + e.getMessage());
- Network.log.logSevere("database inconsistency (" + e.getMessage() + "), re-set of db.");
+ Network.log.severe("database inconsistency (" + e.getMessage() + "), re-set of db.");
this.seedDB.resetActiveTable();
return null;
}
@@ -433,7 +433,7 @@ public class DHTSelection {
}
} catch (final kelondroException e) {
System.out.println("DEBUG providesRemoteCrawlURLsEnum:" + e.getMessage());
- Network.log.logSevere("database inconsistency (" + e.getMessage() + "), re-set of db.");
+ Network.log.severe("database inconsistency (" + e.getMessage() + "), re-set of db.");
this.seedDB.resetActiveTable();
return null;
}
@@ -478,7 +478,7 @@ public class DHTSelection {
}
return result;
} catch (final kelondroException e) {
- Network.log.logSevere("Internal Error at yacySeedDB.seedsByAge: " + e.getMessage(), e);
+ Network.log.severe("Internal Error at yacySeedDB.seedsByAge: " + e.getMessage(), e);
return null;
}
}
diff --git a/source/net/yacy/peers/Dispatcher.java b/source/net/yacy/peers/Dispatcher.java
index 242052994..c8fe1dcdf 100644
--- a/source/net/yacy/peers/Dispatcher.java
+++ b/source/net/yacy/peers/Dispatcher.java
@@ -36,12 +36,12 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.federate.yacy.Distribution;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.util.ByteArray;
import net.yacy.kelondro.workflow.WorkflowProcessor;
@@ -92,7 +92,7 @@ public class Dispatcher {
private final SeedDB seeds;
// the log
- private final Log log;
+ private final ConcurrentLog log;
// transmission process
private WorkflowProcessor<Transmission.Chunk> indexingTransmissionProcessor;
@@ -109,7 +109,7 @@ public class Dispatcher {
this.transmissionCloud = new ConcurrentHashMap<ByteArray, Transmission.Chunk>();
this.segment = segment;
this.seeds = seeds;
- this.log = new Log("INDEX-TRANSFER-DISPATCHER");
+ this.log = new ConcurrentLog("INDEX-TRANSFER-DISPATCHER");
this.transmission = new Transmission(
this.log,
segment,
@@ -199,8 +199,8 @@ public class Dispatcher {
for (final ReferenceContainer<WordReference> c: containers) {
urlHashes.clear();
it = c.entries();
- while (it.hasNext()) try { urlHashes.put(it.next().urlhash()); } catch (final SpaceExceededException e) { Log.logException(e); }
- if (this.log.isFine()) this.log.logFine("selected " + urlHashes.size() + " urls for word '" + ASCII.String(c.getTermHash()) + "'");
+ while (it.hasNext()) try { urlHashes.put(it.next().urlhash()); } catch (final SpaceExceededException e) { ConcurrentLog.logException(e); }
+ if (this.log.isFine()) this.log.fine("selected " + urlHashes.size() + " urls for word '" + ASCII.String(c.getTermHash()) + "'");
if (this.segment.termIndex() != null && !urlHashes.isEmpty()) this.segment.termIndex().remove(c.getTermHash(), urlHashes);
}
rc = containers;
@@ -211,7 +211,7 @@ public class Dispatcher {
for (final ReferenceContainer<WordReference> c: containers) {
container = this.segment.termIndex() == null ? null : this.segment.termIndex().remove(c.getTermHash()); // be aware this might be null!
if (container != null && !container.isEmpty()) {
- if (this.log.isFine()) this.log.logFine("selected " + container.size() + " urls for word '" + ASCII.String(c.getTermHash()) + "'");
+ if (this.log.isFine()) this.log.fine("selected " + container.size() + " urls for word '" + ASCII.String(c.getTermHash()) + "'");
rc.add(container);
}
}
@@ -293,7 +293,7 @@ public class Dispatcher {
primaryTarget,
this.seeds.redundancy() * 3,
true);
- this.log.logInfo("enqueueContainers: selected " + targets.size() + " targets for primary target key " + ASCII.String(primaryTarget) + "/" + vertical + " with " + containers[vertical].size() + " index containers.");
+ this.log.info("enqueueContainers: selected " + targets.size() + " targets for primary target key " + ASCII.String(primaryTarget) + "/" + vertical + " with " + containers[vertical].size() + " index containers.");
if (entry == null) entry = this.transmission.newChunk(primaryTarget, targets);
/*/ lookup targets
@@ -311,7 +311,7 @@ public class Dispatcher {
try {
entry.add(c);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
break;
}
}
@@ -333,13 +333,13 @@ public class Dispatcher {
try {
selectedContainerCache = selectContainers(hash, limitHash, maxContainerCount, maxReferenceCount, maxtime);
} catch (final IOException e) {
- this.log.logSevere("selectContainersEnqueueToCloud: selectedContainer failed", e);
+ this.log.severe("selectContainersEnqueueToCloud: selectedContainer failed", e);
return false;
}
- this.log.logInfo("selectContainersEnqueueToCloud: selectedContainerCache was filled with " + selectedContainerCache.size() + " entries");
+ this.log.info("selectContainersEnqueueToCloud: selectedContainerCache was filled with " + selectedContainerCache.size() + " entries");
if (selectedContainerCache == null || selectedContainerCache.isEmpty()) {
- this.log.logInfo("selectContainersEnqueueToCloud: selectedContainerCache is empty, cannot do anything here.");
+ this.log.info("selectContainersEnqueueToCloud: selectedContainerCache is empty, cannot do anything here.");
return false;
}
@@ -347,22 +347,22 @@ public class Dispatcher {
try {
splitContainerCache = splitContainers(selectedContainerCache);
} catch (final SpaceExceededException e) {
- this.log.logSevere("selectContainersEnqueueToCloud: splitContainers failed because of too low RAM", e);
+ this.log.severe("selectContainersEnqueueToCloud: splitContainers failed because of too low RAM", e);
return false;
}
selectedContainerCache = null;
if (splitContainerCache == null) {
- this.log.logInfo("selectContainersEnqueueToCloud: splitContainerCache is empty, cannot do anything here.");
+ this.log.info("selectContainersEnqueueToCloud: splitContainerCache is empty, cannot do anything here.");
return false;
}
- this.log.logInfo("splitContainersFromCache: splitContainerCache filled with " + splitContainerCache.length + " partitions, deleting selectedContainerCache");
+ this.log.info("splitContainersFromCache: splitContainerCache filled with " + splitContainerCache.length + " partitions, deleting selectedContainerCache");
if (splitContainerCache.length != this.seeds.scheme.verticalPartitions()) {
- this.log.logWarning("selectContainersEnqueueToCloud: splitContainerCache has wrong length.");
+ this.log.warn("selectContainersEnqueueToCloud: splitContainerCache has wrong length.");
return false;
}
enqueueContainersToCloud(splitContainerCache);
splitContainerCache = null;
- this.log.logInfo("selectContainersEnqueueToCloud: splitContainerCache enqueued to cloud array which has now " + this.transmissionCloud.size() + " entries.");
+ this.log.info("selectContainersEnqueueToCloud: splitContainerCache enqueued to cloud array which has now " + this.transmissionCloud.size() + " entries.");
return true;
}
@@ -403,17 +403,17 @@ public class Dispatcher {
if (success && chunk.isFinished()) {
// finished with this queue!
- this.log.logInfo("STORE: Chunk " + ASCII.String(chunk.primaryTarget()) + " has FINISHED all transmissions!");
+ this.log.info("STORE: Chunk " + ASCII.String(chunk.primaryTarget()) + " has FINISHED all transmissions!");
return chunk;
}
- if (!success) this.log.logInfo("STORE: Chunk " + ASCII.String(chunk.primaryTarget()) + " has failed to transmit index; marked peer as busy");
+ if (!success) this.log.info("STORE: Chunk " + ASCII.String(chunk.primaryTarget()) + " has failed to transmit index; marked peer as busy");
if (chunk.canFinish()) {
if (this.indexingTransmissionProcessor != null) this.indexingTransmissionProcessor.enQueue(chunk);
return chunk;
}
- this.log.logInfo("STORE: Chunk " + ASCII.String(chunk.primaryTarget()) + " has not enough targets left. This transmission has failed, putting back index to backend");
+ this.log.info("STORE: Chunk " + ASCII.String(chunk.primaryTarget()) + " has not enough targets left. This transmission has failed, putting back index to backend");
chunk.restore();
return null;
}
@@ -426,7 +426,7 @@ public class Dispatcher {
for (final ReferenceContainer<WordReference> i : e.getValue()) try {
this.segment.storeRWI(i);
} catch (final Exception e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
break outerLoop;
}
}
diff --git a/source/net/yacy/peers/Network.java b/source/net/yacy/peers/Network.java
index 360b3f42e..15eaaec0a 100644
--- a/source/net/yacy/peers/Network.java
+++ b/source/net/yacy/peers/Network.java
@@ -54,8 +54,8 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.RSSFeed;
import net.yacy.cora.document.RSSMessage;
import net.yacy.cora.protocol.Domains;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.peers.operation.yacySeedUploadFile;
import net.yacy.peers.operation.yacySeedUploadFtp;
import net.yacy.peers.operation.yacySeedUploadScp;
@@ -70,7 +70,7 @@ public class Network
// statics
public static final ThreadGroup publishThreadGroup = new ThreadGroup("publishThreadGroup");
public static final HashMap<String, String> seedUploadMethods = new HashMap<String, String>();
- public static final Log log = new Log("YACY");
+ public static final ConcurrentLog log = new ConcurrentLog("YACY");
public static long lastOnlineTime = 0;
/** pseudo-random key derived from a time-interval while YaCy startup */
public static long speedKey = 0;
@@ -110,14 +110,14 @@ public class Network
if ( staticIP.length() != 0 && Seed.isProperIP(staticIP) == null ) {
serverCore.useStaticIP = true;
sb.peers.mySeed().setIP(staticIP);
- log.logInfo("staticIP set to " + staticIP);
+ log.info("staticIP set to " + staticIP);
} else {
serverCore.useStaticIP = false;
}
loadSeedUploadMethods();
- log.logConfig("CORE INITIALIZED");
+ log.config("CORE INITIALIZED");
// ATTENTION, VERY IMPORTANT: before starting the thread, the httpd yacy server must be running!
speedKey = System.currentTimeMillis() - time;
@@ -130,7 +130,7 @@ public class Network
public final void publishSeedList() {
if ( log.isFine() ) {
- log.logFine("yacyCore.publishSeedList: Triggered Seed Publish");
+ log.fine("yacyCore.publishSeedList: Triggered Seed Publish");
}
/*
@@ -148,7 +148,7 @@ public class Network
&& (this.sb.peers.mySeed().isPrincipal()) ) {
if ( log.isFine() ) {
log
- .logFine("yacyCore.publishSeedList: not necessary to publish: oldIP is equal, sizeConnected is equal and I can reach myself under the old IP.");
+ .fine("yacyCore.publishSeedList: not necessary to publish: oldIP is equal, sizeConnected is equal and I can reach myself under the old IP.");
}
return;
}
@@ -174,7 +174,7 @@ public class Network
this.sb.setConfig("seedUploadMethod", "none");
}
if ( log.isFine() ) {
- log.logFine("yacyCore.publishSeedList: No uploading method configured");
+ log.fine("yacyCore.publishSeedList: No uploading method configured");
}
return;
}
@@ -198,13 +198,13 @@ public class Network
if ( this.sb.peers.sizeConnected() == 0 ) {
// reload the seed lists
this.sb.loadSeedLists();
- log.logInfo("re-initialized seed list. received "
+ log.info("re-initialized seed list. received "
+ this.sb.peers.sizeConnected()
+ " new peer(s)");
}
final int newSeeds = publishMySeed(false);
if ( newSeeds > 0 ) {
- log.logInfo("received "
+ log.info("received "
+ newSeeds
+ " new peer(s), know a total of "
+ this.sb.peers.sizeConnected()
@@ -252,7 +252,7 @@ public class Network
if ( this.added < 0 ) {
// no or wrong response, delete that address
final String cause = "peer ping to peer resulted in error response (added < 0)";
- log.logInfo("publish: disconnected "
+ log.info("publish: disconnected "
+ this.seed.get(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR)
+ " peer '"
+ this.seed.getName()
@@ -264,7 +264,7 @@ public class Network
} else {
// success! we have published our peer to a senior peer
// update latest news from the other peer
- log.logInfo("publish: handshaked "
+ log.info("publish: handshaked "
+ this.seed.get(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR)
+ " peer '"
+ this.seed.getName()
@@ -275,7 +275,7 @@ public class Network
if ( newSeed != null ) {
if ( !newSeed.isOnline() ) {
if ( log.isFine() ) {
- log.logFine("publish: recently handshaked "
+ log.fine("publish: recently handshaked "
+ this.seed.get(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR)
+ " peer '"
+ this.seed.getName()
@@ -290,7 +290,7 @@ public class Network
if ( newSeed.getLastSeenUTC() >= this.seed.getLastSeenUTC() ) {
if ( log.isFine() ) {
log
- .logFine("publish: recently handshaked "
+ .fine("publish: recently handshaked "
+ this.seed.get(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR)
+ " peer '"
+ this.seed.getName()
@@ -305,7 +305,7 @@ public class Network
} else {
if ( log.isFine() ) {
log
- .logFine("publish: recently handshaked "
+ .fine("publish: recently handshaked "
+ this.seed.get(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR)
+ " peer '"
+ this.seed.getName()
@@ -325,7 +325,7 @@ public class Network
}
} else {
if ( log.isFine() ) {
- log.logFine("publish: recently handshaked "
+ log.fine("publish: recently handshaked "
+ this.seed.get(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR)
+ " peer '"
+ this.seed.getName()
@@ -336,8 +336,8 @@ public class Network
}
}
} catch ( final Exception e ) {
- Log.logException(e);
- log.logSevere(
+ ConcurrentLog.logException(e);
+ log.severe(
"publishThread: error with target seed " + this.seed.toString() + ": " + e.getMessage(),
e);
} finally {
@@ -432,7 +432,7 @@ public class Network
this.sb.peers.mySeed().put("news", net.yacy.utils.crypt.simpleEncode(record.toString()));
}
} catch ( final Exception e ) {
- log.logSevere("publishMySeed: problem with news encoding", e);
+ log.severe("publishMySeed: problem with news encoding", e);
}
this.sb.peers.mySeed().setUnusedFlags();
int newSeeds = -1;
@@ -454,7 +454,7 @@ public class Network
final String address = seed.getClusterAddress();
if ( log.isFine() ) {
- log.logFine("HELLO #" + i + " to peer '" + seed.get(Seed.NAME, "") + "' at " + address); // debug
+ log.fine("HELLO #" + i + " to peer '" + seed.get(Seed.NAME, "") + "' at " + address); // debug
}
final String seederror = seed.isProper(false);
if ( (address == null) || (seederror != null) ) {
@@ -479,7 +479,7 @@ public class Network
// if this is true something is wrong ...
if ( syncList.isEmpty() ) {
- log.logWarning("PeerPing: syncList.isEmpty()==true");
+ log.warn("PeerPing: syncList.isEmpty()==true");
continue;
//return 0;
}
@@ -518,13 +518,13 @@ public class Network
}
if ( log.isFine() ) {
log
- .logFine("DBSize before -> after Cleanup: "
+ .fine("DBSize before -> after Cleanup: "
+ dbSize
+ " -> "
+ amIAccessibleDB.size());
}
}
- log.logInfo("PeerPing: I am accessible for "
+ log.info("PeerPing: I am accessible for "
+ accessible
+ " peer(s), not accessible for "
+ notaccessible
@@ -545,9 +545,9 @@ public class Network
newPeerType = Seed.PEERTYPE_JUNIOR;
}
if ( this.sb.peers.mySeed().orVirgin().equals(newPeerType) ) {
- log.logInfo("PeerPing: myType is " + this.sb.peers.mySeed().orVirgin());
+ log.info("PeerPing: myType is " + this.sb.peers.mySeed().orVirgin());
} else {
- log.logInfo("PeerPing: changing myType from '"
+ log.info("PeerPing: changing myType from '"
+ this.sb.peers.mySeed().orVirgin()
+ "' to '"
+ newPeerType
@@ -555,7 +555,7 @@ public class Network
this.sb.peers.mySeed().put(Seed.PEERTYPE, newPeerType);
}
} else {
- log.logInfo("PeerPing: No data, staying at myType: " + this.sb.peers.mySeed().orVirgin());
+ log.info("PeerPing: No data, staying at myType: " + this.sb.peers.mySeed().orVirgin());
}
// success! we have published our peer to a senior peer
@@ -584,7 +584,7 @@ public class Network
if ( this.sb.peers.mySeed().get(Seed.PEERTYPE, Seed.PEERTYPE_JUNIOR).equals(Seed.PEERTYPE_JUNIOR) ) {
this.sb.peers.mySeed().put(Seed.PEERTYPE, Seed.PEERTYPE_SENIOR); // to start bootstraping, we need to be recognised as PEERTYPE_SENIOR peer
}
- log.logInfo("publish: no recipient found, our address is "
+ log.info("publish: no recipient found, our address is "
+ ((this.sb.peers.mySeed().getPublicAddress() == null) ? "unknown" : this.sb.peers
.mySeed()
.getPublicAddress()));
@@ -592,13 +592,13 @@ public class Network
return 0;
} catch ( final InterruptedException e ) {
try {
- log.logInfo("publish: Interruption detected while publishing my seed.");
+ log.info("publish: Interruption detected while publishing my seed.");
// consuming the theads interrupted signal
Thread.interrupted();
// interrupt all already started publishThreads
- log.logInfo("publish: Signaling shutdown to "
+ log.info("publish: Signaling shutdown to "
+ Network.publishThreadGroup.activeCount()
+ " remaining publishing threads ...");
Network.publishThreadGroup.interrupt();
@@ -616,7 +616,7 @@ public class Network
// we need to use a timeout here because of missing interruptable session threads ...
if ( log.isFine() ) {
- log.logFine("publish: Waiting for "
+ log.fine("publish: Waiting for "
+ Network.publishThreadGroup.activeCount()
+ " remaining publishing threads to finish shutdown ...");
}
@@ -625,7 +625,7 @@ public class Network
if ( currentThread.isAlive() ) {
if ( log.isFine() ) {
- log.logFine("publish: Waiting for remaining publishing thread '"
+ log.fine("publish: Waiting for remaining publishing thread '"
+ currentThread.getName()
+ "' to finish shutdown");
}
@@ -636,10 +636,10 @@ public class Network
}
}
- log.logInfo("publish: Shutdown off all remaining publishing thread finished.");
+ log.info("publish: Shutdown off all remaining publishing thread finished.");
} catch ( final Exception ee ) {
- log.logWarning(
+ log.warn(
"publish: Unexpected error while trying to shutdown all remaining publishing threads.",
e);
}
@@ -716,7 +716,7 @@ public class Network
// be shure that we have something to say
if ( sb.peers.mySeed().getPublicAddress() == null ) {
final String errorMsg = "We have no valid IP address until now";
- log.logWarning("SaveSeedList: " + errorMsg);
+ log.warn("SaveSeedList: " + errorMsg);
return errorMsg;
}
@@ -748,7 +748,7 @@ public class Network
"Unable to get the proper uploader-class for seed uploading method '"
+ seedUploadMethod
+ "'.";
- log.logWarning("SaveSeedList: " + errorMsg);
+ log.warn("SaveSeedList: " + errorMsg);
return errorMsg;
}
@@ -767,7 +767,7 @@ public class Network
final String host = seedURL.getHost();
if (Domains.isLocalhost(host)) { // check seedlist reacheable
final String errorMsg = "seedURL in localhost rejected (localhost can't be reached from outside)";
- log.logWarning("SaveSeedList: " + errorMsg);
+ log.warn("SaveSeedList: " + errorMsg);
return errorMsg;
}
} catch ( final MalformedURLException e ) {
@@ -776,7 +776,7 @@ public class Network
+ sb.peers.mySeed().get(Seed.SEEDLISTURL, "")
+ "'. "
+ e.getMessage();
- log.logWarning("SaveSeedList: " + errorMsg);
+ log.warn("SaveSeedList: " + errorMsg);
return errorMsg;
}
@@ -790,7 +790,7 @@ public class Network
sb.peers.mySeed().put(Seed.PEERTYPE, Seed.PEERTYPE_PRINCIPAL); // this information shall also be uploaded
if ( log.isFine() ) {
- log.logFine("SaveSeedList: Using seed uploading method '"
+ log.fine("SaveSeedList: Using seed uploading method '"
+ seedUploadMethod
+ "' for seed-list uploading."
+ "\n\tPrevious peerType is '"
@@ -807,10 +807,10 @@ public class Network
+ uploader.getClass().getName()
+ " (error): "
+ logt.substring(logt.indexOf("Error", 0) + 6);
- log.logSevere(errorMsg);
+ log.severe(errorMsg);
return errorMsg;
}
- log.logInfo(logt);
+ log.info(logt);
}
// finally, set the principal status
@@ -820,7 +820,7 @@ public class Network
sb.peers.mySeed().put(Seed.PEERTYPE, prevStatus);
sb.setConfig("yacyStatus", prevStatus);
final String errorMsg = "SaveSeedList: Seed upload failed (IO error): " + e.getMessage();
- log.logInfo(errorMsg, e);
+ log.info(errorMsg, e);
return errorMsg;
}
} finally {
diff --git a/source/net/yacy/peers/NewsDB.java b/source/net/yacy/peers/NewsDB.java
index 4486a650c..a01ac8a51 100644
--- a/source/net/yacy/peers/NewsDB.java
+++ b/source/net/yacy/peers/NewsDB.java
@@ -57,11 +57,11 @@ import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MapTools;
@@ -103,7 +103,7 @@ public class NewsDB {
try {
this.news = new Table(path, this.rowdef, 0, 0, false, exceed134217727, true);
} catch (final SpaceExceededException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
}
@@ -117,7 +117,7 @@ public class NewsDB {
try {
this.news = new Table(this.path, this.rowdef, 0, 0, false, false, true);
} catch (final SpaceExceededException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
}
@@ -176,7 +176,7 @@ public class NewsDB {
if (r == null) return null;
String attributes = r.attributes().toString();
if (attributes.length() > this.attributesMaxLength) {
- Log.logWarning("yacyNewsDB", "attribute length=" + attributes.length() + " exceeds maximum size=" + this.attributesMaxLength);
+ ConcurrentLog.warn("yacyNewsDB", "attribute length=" + attributes.length() + " exceeds maximum size=" + this.attributesMaxLength);
attributes = new HashMap<String, String>().toString();
}
final Row.Entry entry = this.news.row().newEntry();
@@ -199,7 +199,7 @@ public class NewsDB {
}
return new Record(mySeed, category, m);
} catch (final IllegalArgumentException e) {
- Network.log.logWarning("rejected bad yacy news record (1): " + e.getMessage());
+ Network.log.warn("rejected bad yacy news record (1): " + e.getMessage());
return null;
}
}
@@ -208,7 +208,7 @@ public class NewsDB {
try {
return new Record(mySeed, category, attributes);
} catch (final IllegalArgumentException e) {
- Network.log.logWarning("rejected bad yacy news record (2): " + e.getMessage());
+ Network.log.warn("rejected bad yacy news record (2): " + e.getMessage());
return null;
}
}
@@ -217,7 +217,7 @@ public class NewsDB {
try {
return new Record(external);
} catch (final IllegalArgumentException e) {
- Network.log.logWarning("rejected bad yacy news record (3): " + e.getMessage());
+ Network.log.warn("rejected bad yacy news record (3): " + e.getMessage());
return null;
}
}
diff --git a/source/net/yacy/peers/NewsPool.java b/source/net/yacy/peers/NewsPool.java
index 11f025515..0be6eeac3 100644
--- a/source/net/yacy/peers/NewsPool.java
+++ b/source/net/yacy/peers/NewsPool.java
@@ -53,9 +53,9 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
@@ -311,7 +311,7 @@ public class NewsPool {
this.outgoingNews.push(record); // .. and put it on the publishing list
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/peers/NewsQueue.java b/source/net/yacy/peers/NewsQueue.java
index ef59e0d85..f06bc8f98 100644
--- a/source/net/yacy/peers/NewsQueue.java
+++ b/source/net/yacy/peers/NewsQueue.java
@@ -52,10 +52,10 @@ import java.util.Iterator;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.NaturalOrder;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.Column;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.FileUtils;
@@ -78,7 +78,7 @@ public class NewsQueue implements Iterable<NewsDB.Record> {
try {
this.queueStack = new Table(path, rowdef, 10, 0, false, false, true);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.queueStack = null;
}
}
@@ -92,7 +92,7 @@ public class NewsQueue implements Iterable<NewsDB.Record> {
try {
this.queueStack = new Table(this.path, rowdef, 10, 0, false, false, true);
} catch (final SpaceExceededException ee) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.queueStack = null;
}
}
@@ -118,7 +118,7 @@ public class NewsQueue implements Iterable<NewsDB.Record> {
public synchronized void push(final NewsDB.Record entry) throws IOException, SpaceExceededException {
if (!this.queueStack.consistencyCheck()) {
- Log.logSevere("yacyNewsQueue", "reset of table " + this.path);
+ ConcurrentLog.severe("yacyNewsQueue", "reset of table " + this.path);
this.queueStack.clear();
}
this.queueStack.addUnique(r2b(entry));
@@ -148,7 +148,7 @@ public class NewsQueue implements Iterable<NewsDB.Record> {
try {
this.queueStack.remove(UTF8.getBytes(id));
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return record;
}
@@ -188,7 +188,7 @@ public class NewsQueue implements Iterable<NewsDB.Record> {
try {
this.stackNodeIterator = NewsQueue.this.queueStack.rows();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.stackNodeIterator = null;
}
}
diff --git a/source/net/yacy/peers/PeerActions.java b/source/net/yacy/peers/PeerActions.java
index c95949616..0ce06780b 100644
--- a/source/net/yacy/peers/PeerActions.java
+++ b/source/net/yacy/peers/PeerActions.java
@@ -57,42 +57,42 @@ public class PeerActions {
// store a remote peer's seed
// returns true if the peer is new and previously unknown
if (seed == null) {
- Network.log.logSevere("connect: WRONG seed (NULL)");
+ Network.log.severe("connect: WRONG seed (NULL)");
return false;
}
final String error = seed.isProper(false);
if (error != null) {
- Network.log.logSevere("connect: WRONG seed (" + seed.getName() + "/" + seed.hash + "): " + error);
+ Network.log.severe("connect: WRONG seed (" + seed.getName() + "/" + seed.hash + "): " + error);
return false;
}
if ((this.seedDB.mySeedIsDefined()) && (seed.hash.equals(this.seedDB.mySeed().hash))) {
- Network.log.logInfo("connect: SELF reference " + seed.getPublicAddress());
+ Network.log.info("connect: SELF reference " + seed.getPublicAddress());
return false;
}
final String peerType = seed.get(Seed.PEERTYPE, Seed.PEERTYPE_VIRGIN);
if ((peerType.equals(Seed.PEERTYPE_VIRGIN)) || (peerType.equals(Seed.PEERTYPE_JUNIOR))) {
// reject unqualified seeds
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting NOT QUALIFIED " + peerType + " seed " + seed.getName());
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting NOT QUALIFIED " + peerType + " seed " + seed.getName());
return false;
}
if (!(peerType.equals(Seed.PEERTYPE_SENIOR) || peerType.equals(Seed.PEERTYPE_PRINCIPAL))) {
// reject unqualified seeds
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting NOT QUALIFIED " + peerType + " seed " + seed.getName());
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting NOT QUALIFIED " + peerType + " seed " + seed.getName());
return false;
}
final Seed doubleSeed = this.seedDB.lookupByIP(seed.getInetAddress(), seed.getPort(), true, false, false);
if ((doubleSeed != null) && (doubleSeed.getPort() == seed.getPort()) && (!(doubleSeed.hash.equals(seed.hash)))) {
// a user frauds with his peer different peer hashes
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting FRAUD (double hashes " + doubleSeed.hash + "/" + seed.hash + " on same port " + seed.getPort() + ") peer " + seed.getName());
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting FRAUD (double hashes " + doubleSeed.hash + "/" + seed.hash + " on same port " + seed.getPort() + ") peer " + seed.getName());
return false;
}
if (seed.get(Seed.LASTSEEN, "").length() != 14) {
// hack for peers that do not have a LastSeen date
seed.setLastSeenUTC();
- if (Network.log.isFine()) Network.log.logFine("connect: reset wrong date (" + seed.getName() + "/" + seed.hash + ")");
+ if (Network.log.isFine()) Network.log.fine("connect: reset wrong date (" + seed.getName() + "/" + seed.hash + ")");
}
// connection time
@@ -107,7 +107,7 @@ public class PeerActions {
}
if (Math.abs(nowUTC0Time - ctimeUTC0) / 1000 / 60 > 60 * 6 ) {
// the new connection is out-of-age, we reject the connection
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting out-dated peer '" + seed.getName() + "' from " + seed.getPublicAddress() + "; nowUTC0=" + nowUTC0Time + ", seedUTC0=" + ctimeUTC0 + ", TimeDiff=" + formatInterval(Math.abs(nowUTC0Time - ctimeUTC0)));
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting out-dated peer '" + seed.getName() + "' from " + seed.getPublicAddress() + "; nowUTC0=" + nowUTC0Time + ", seedUTC0=" + ctimeUTC0 + ", TimeDiff=" + formatInterval(Math.abs(nowUTC0Time - ctimeUTC0)));
return false;
}
@@ -144,13 +144,13 @@ public class PeerActions {
if (!direct) {
if (ctimeUTC0 < dtimeUTC0) {
// the disconnection was later, we reject the connection
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting disconnected peer '" + seed.getName() + "' from " + seed.getPublicAddress());
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting disconnected peer '" + seed.getName() + "' from " + seed.getPublicAddress());
return false;
}
}
// this is a return of a lost peer
- if (Network.log.isFine()) Network.log.logFine("connect: returned KNOWN " + peerType + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
+ if (Network.log.isFine()) Network.log.fine("connect: returned KNOWN " + peerType + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
this.seedDB.addConnected(seed);
return true;
}
@@ -161,7 +161,7 @@ public class PeerActions {
// if the old LastSeen date is later then the other
// info, then we reject the info
if ((ctimeUTC0 < (connectedSeed.getLastSeenUTC())) && (!direct)) {
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting old info about peer '" + seed.getName() + "'");
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting old info about peer '" + seed.getName() + "'");
return false;
}
@@ -169,10 +169,10 @@ public class PeerActions {
// TODO: update seed name lookup cache
}*/
} catch (final NumberFormatException e) {
- if (Network.log.isFine()) Network.log.logFine("connect: rejecting wrong peer '" + seed.getName() + "' from " + seed.getPublicAddress() + ". Cause: " + e.getMessage());
+ if (Network.log.isFine()) Network.log.fine("connect: rejecting wrong peer '" + seed.getName() + "' from " + seed.getPublicAddress() + ". Cause: " + e.getMessage());
return false;
}
- if (Network.log.isFine()) Network.log.logFine("connect: updated KNOWN " + ((direct) ? "direct " : "") + peerType + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
+ if (Network.log.isFine()) Network.log.fine("connect: updated KNOWN " + ((direct) ? "direct " : "") + peerType + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
this.seedDB.addConnected(seed);
return true;
}
@@ -181,10 +181,10 @@ public class PeerActions {
if ((this.seedDB.mySeedIsDefined()) && (seed.getIP().equals(this.seedDB.mySeed().getIP()))) {
// seed from the same IP as the calling client: can be
// the case if there runs another one over a NAT
- if (Network.log.isFine()) Network.log.logFine("connect: saved NEW seed (myself IP) " + seed.getPublicAddress());
+ if (Network.log.isFine()) Network.log.fine("connect: saved NEW seed (myself IP) " + seed.getPublicAddress());
} else {
// completely new seed
- if (Network.log.isFine()) Network.log.logFine("connect: saved NEW " + peerType + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
+ if (Network.log.isFine()) Network.log.fine("connect: saved NEW " + peerType + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
}
this.seedDB.addConnected(seed);
return true;
@@ -204,7 +204,7 @@ public class PeerActions {
public void peerDeparture(final Seed peer, final String cause) {
if (peer == null) return;
// we do this if we did not get contact with the other peer
- if (Network.log.isFine()) Network.log.logFine("connect: no contact to a " + peer.get(Seed.PEERTYPE, Seed.PEERTYPE_VIRGIN) + " peer '" + peer.getName() + "' at " + peer.getPublicAddress() + ". Cause: " + cause);
+ if (Network.log.isFine()) Network.log.fine("connect: no contact to a " + peer.get(Seed.PEERTYPE, Seed.PEERTYPE_VIRGIN) + " peer '" + peer.getName() + "' at " + peer.getPublicAddress() + ". Cause: " + cause);
synchronized (this.seedDB) {
if (!this.seedDB.hasDisconnected(ASCII.getBytes(peer.hash))) { this.disconnects++; }
peer.put("dct", Long.toString(System.currentTimeMillis()));
@@ -239,7 +239,7 @@ public class PeerActions {
try {
synchronized (this.newsPool) {this.newsPool.enqueueIncomingNews(record);}
} catch (final Exception e) {
- Network.log.logSevere("processPeerArrival", e);
+ Network.log.severe("processPeerArrival", e);
}
}
}
diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.java
index 2ef361307..4fb9234c8 100644
--- a/source/net/yacy/peers/Protocol.java
+++ b/source/net/yacy/peers/Protocol.java
@@ -82,6 +82,7 @@ import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.crawler.data.ResultURLs.EventOrigin;
@@ -90,7 +91,6 @@ import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceFactory;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceContainerCache;
@@ -203,12 +203,12 @@ public final class Protocol {
result = FileUtils.table(content);
} catch ( final Exception e ) {
if ( Thread.currentThread().isInterrupted() ) {
- Network.log.logInfo("yacyClient.hello thread '"
+ Network.log.info("yacyClient.hello thread '"
+ Thread.currentThread().getName()
+ "' interrupted.");
return -1;
}
- Network.log.logInfo("yacyClient.hello thread '"
+ Network.log.info("yacyClient.hello thread '"
+ Thread.currentThread().getName()
+ "', peer "
+ address
@@ -219,11 +219,11 @@ public final class Protocol {
}
if (result == null || result.size() == 0) {
- Network.log.logInfo("yacyClient.hello result error: "
+ Network.log.info("yacyClient.hello result error: "
+ ((result == null) ? "result null" : ("result=" + result.toString())));
return -1;
}
- Network.log.logInfo("yacyClient.hello thread '"
+ Network.log.info("yacyClient.hello thread '"
+ Thread.currentThread().getName()
+ "' contacted peer at "
+ address
@@ -238,7 +238,7 @@ public final class Protocol {
String seed;
if ( (otherHash != null) && (otherHash.length() > 0) && ((seed = result.get("seed0")) != null) ) {
if ( seed.length() > Seed.maxsize ) {
- Network.log.logInfo("hello/client 0: rejected contacting seed; too large ("
+ Network.log.info("hello/client 0: rejected contacting seed; too large ("
+ seed.length()
+ " > "
+ Seed.maxsize
@@ -254,14 +254,14 @@ public final class Protocol {
final String host = ie == null ? h : ie.getHostAddress(); // hack to prevent NPEs
otherPeer = Seed.genRemoteSeed(seed, false, host);
if ( !otherPeer.hash.equals(otherHash) ) {
- Network.log.logInfo("yacyClient.hello: consistency error: otherPeer.hash = "
+ Network.log.info("yacyClient.hello: consistency error: otherPeer.hash = "
+ otherPeer.hash
+ ", otherHash = "
+ otherHash);
return -1; // no success
}
} catch ( final IOException e ) {
- Network.log.logInfo("yacyClient.hello: consistency error: other seed bad:"
+ Network.log.info("yacyClient.hello: consistency error: other seed bad:"
+ e.getMessage()
+ ", seed="
+ seed);
@@ -308,13 +308,13 @@ public final class Protocol {
* If this is true we try to reconnect the sch channel to the remote server now.
*/
if ( mytype.equalsIgnoreCase(Seed.PEERTYPE_JUNIOR) ) {
- Network.log.logInfo("yacyClient.hello: Peer '"
+ Network.log.info("yacyClient.hello: Peer '"
+ ((otherPeer == null) ? "unknown" : otherPeer.getName())
+ "' reported us as junior.");
} else if ( (mytype.equalsIgnoreCase(Seed.PEERTYPE_SENIOR))
|| (mytype.equalsIgnoreCase(Seed.PEERTYPE_PRINCIPAL)) ) {
if ( Network.log.isFine() ) {
- Network.log.logFine("yacyClient.hello: Peer '"
+ Network.log.fine("yacyClient.hello: Peer '"
+ ((otherPeer == null) ? "unknown" : otherPeer.getName())
+ "' reported us as "
+ mytype
@@ -323,7 +323,7 @@ public final class Protocol {
} else {
// wrong type report
if ( Network.log.isFine() ) {
- Network.log.logFine("yacyClient.hello: Peer '"
+ Network.log.fine("yacyClient.hello: Peer '"
+ ((otherPeer == null) ? "unknown" : otherPeer.getName())
+ "' reported us as "
+ mytype
@@ -337,7 +337,7 @@ public final class Protocol {
final String error = mySeed.isProper(true);
if ( error != null ) {
- Network.log.logWarning("yacyClient.hello mySeed error - not proper: " + error);
+ Network.log.warn("yacyClient.hello mySeed error - not proper: " + error);
return -1;
}
@@ -353,7 +353,7 @@ public final class Protocol {
// integrate new seed into own database
// the first seed, "seed0" is the seed of the responding peer
if ( seedStr.length() > Seed.maxsize ) {
- Network.log.logInfo("hello/client: rejected contacting seed; too large ("
+ Network.log.info("hello/client: rejected contacting seed; too large ("
+ seedStr.length()
+ " > "
+ Seed.maxsize
@@ -376,7 +376,7 @@ public final class Protocol {
count++;
}
} catch ( final IOException e ) {
- Network.log.logInfo("hello/client: rejected contacting seed; bad ("
+ Network.log.info("hello/client: rejected contacting seed; bad ("
+ e.getMessage()
+ ")");
}
@@ -450,7 +450,7 @@ public final class Protocol {
//final Date remoteTime = yacyCore.parseUniversalDate((String) result.get(yacySeed.MYTIME)); // read remote time
return Seed.genRemoteSeed(result.get("response"), false, target.getIP());
} catch ( final Exception e ) {
- Network.log.logWarning("yacyClient.querySeed error:" + e.getMessage());
+ Network.log.warn("yacyClient.querySeed error:" + e.getMessage());
return null;
}
}
@@ -480,7 +480,7 @@ public final class Protocol {
return new long[] {-1, -1};
}
} catch ( final Exception e ) {
- if (Network.log.isFine()) Network.log.logFine("yacyClient.queryRWICount error:" + e.getMessage());
+ if (Network.log.isFine()) Network.log.fine("yacyClient.queryRWICount error:" + e.getMessage());
return new long[] {-1, -1};
}
}
@@ -496,7 +496,7 @@ public final class Protocol {
}
final int targetCount = Integer.parseInt(target.get(Seed.RCOUNT, "0"));
if ( targetCount <= 0 ) {
- Network.log.logWarning("yacyClient.queryRemoteCrawlURLs wrong peer '"
+ Network.log.warn("yacyClient.queryRemoteCrawlURLs wrong peer '"
+ target.getName()
+ "' selected: not enough links available");
return null;
@@ -520,7 +520,7 @@ public final class Protocol {
+ "/yacy/urls.xml"), target.getHexHash() + ".yacyh", parts, false);
final RSSReader reader = RSSReader.parse(RSSFeed.DEFAULT_MAXSIZE, result);
if ( reader == null ) {
- Network.log.logWarning("yacyClient.queryRemoteCrawlURLs failed asking peer '"
+ Network.log.warn("yacyClient.queryRemoteCrawlURLs failed asking peer '"
+ target.getName()
+ "': probably bad response from remote peer (1), reader == null");
target.put(Seed.RCOUNT, "0");
@@ -531,7 +531,7 @@ public final class Protocol {
final RSSFeed feed = reader.getFeed();
if ( feed == null ) {
// case where the rss reader does not understand the content
- Network.log.logWarning("yacyClient.queryRemoteCrawlURLs failed asking peer '"
+ Network.log.warn("yacyClient.queryRemoteCrawlURLs failed asking peer '"
+ target.getName()
+ "': probably bad response from remote peer (2)");
//System.out.println("***DEBUG*** rss input = " + UTF8.String(result));
@@ -545,7 +545,7 @@ public final class Protocol {
seedDB.update(target.hash, target);
return feed;
} catch ( final IOException e ) {
- Network.log.logWarning("yacyClient.queryRemoteCrawlURLs error asking peer '"
+ Network.log.warn("yacyClient.queryRemoteCrawlURLs error asking peer '"
+ target.getName()
+ "':"
+ e.toString());
@@ -628,7 +628,7 @@ public final class Protocol {
secondarySearchSuperviser
);
} catch ( final IOException e ) {
- Network.log.logInfo("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
+ Network.log.info("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
event.peers.peerActions.peerDeparture(target, "search request to peer created io exception: " + e.getMessage());
return -1;
}
@@ -638,7 +638,7 @@ public final class Protocol {
try {
remoteSearchProcess(event, count, totalrequesttime, wordhashes, target, blacklist, result);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return -1;
}
@@ -653,7 +653,7 @@ public final class Protocol {
ci = new ByteBuffer(abstractEntry.getValue());
wordhash = ASCII.String(abstractEntry.getKey());
} catch ( final OutOfMemoryError e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
whacc += wordhash;
@@ -665,7 +665,7 @@ public final class Protocol {
}
if ( ac > 0 ) {
secondarySearchSuperviser.commitAbstract();
- Network.log.logInfo("remote search: peer " + target.getName() + " sent " + ac + " index abstracts for words " + whacc);
+ Network.log.info("remote search: peer " + target.getName() + " sent " + ac + " index abstracts for words " + whacc);
}
}
return result.availableCount;
@@ -705,7 +705,7 @@ public final class Protocol {
null
);
} catch ( final IOException e ) {
- Network.log.logInfo("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
+ Network.log.info("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
event.peers.peerActions.peerDeparture(target, "search request to peer created io exception: " + e.getMessage());
return -1;
}
@@ -715,7 +715,7 @@ public final class Protocol {
try {
remoteSearchProcess(event, count, totalrequesttime, wordhashes, target, blacklist, result);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return -1;
}
return result.availableCount;
@@ -759,7 +759,7 @@ public final class Protocol {
}
if ( blacklist.isListed(BlacklistType.SEARCH, urlEntry) ) {
if ( Network.log.isInfo() ) {
- Network.log.logInfo("remote search: filtered blacklisted url " + urlEntry.url() + " from peer " + target.getName());
+ Network.log.info("remote search: filtered blacklisted url " + urlEntry.url() + " from peer " + target.getName());
}
continue; // block with backlist
}
@@ -768,7 +768,7 @@ public final class Protocol {
Switchboard.getSwitchboard().crawlStacker.urlInAcceptedDomain(urlEntry.url());
if ( urlRejectReason != null ) {
if ( Network.log.isInfo() ) {
- Network.log.logInfo("remote search: rejected url '" + urlEntry.url() + "' (" + urlRejectReason + ") from peer " + target.getName());
+ Network.log.info("remote search: rejected url '" + urlEntry.url() + "' (" + urlRejectReason + ") from peer " + target.getName());
}
continue; // reject url outside of our domain
}
@@ -776,15 +776,15 @@ public final class Protocol {
// save the url entry
final Reference entry = urlEntry.word();
if ( entry == null ) {
- if ( Network.log.isWarning() ) {
- Network.log.logWarning("remote search: no word attached from peer " + target.getName() + ", version " + target.getVersion());
+ if ( Network.log.isWarn() ) {
+ Network.log.warn("remote search: no word attached from peer " + target.getName() + ", version " + target.getVersion());
}
continue; // no word attached
}
// the search-result-url transports all the attributes of word indexes
if ( !Base64Order.enhancedCoder.equal(entry.urlhash(), urlEntry.hash()) ) {
- Network.log.logInfo("remote search: url-hash " + ASCII.String(urlEntry.hash()) + " does not belong to word-attached-hash " + ASCII.String(entry.urlhash()) + "; url = " + urlEntry.url() + " from peer " + target.getName());
+ Network.log.info("remote search: url-hash " + ASCII.String(urlEntry.hash()) + " does not belong to word-attached-hash " + ASCII.String(entry.urlhash()) + "; url = " + urlEntry.url() + " from peer " + target.getName());
continue; // spammed
}
@@ -812,7 +812,7 @@ public final class Protocol {
try {
c.add(entry);
} catch ( final SpaceExceededException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
break;
}
}
@@ -822,7 +822,7 @@ public final class Protocol {
try {
event.query.getSegment().fulltext().putMetadata(entry);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -838,20 +838,20 @@ public final class Protocol {
try {
event.query.getSegment().storeRWI(c);
} catch ( final Exception e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
// integrate remote top-words/topics
if ( result.references != null && result.references.length > 0 ) {
- Network.log.logInfo("remote search: peer " + target.getName() + " sent " + result.references.length + " topics");
+ Network.log.info("remote search: peer " + target.getName() + " sent " + result.references.length + " topics");
// add references twice, so they can be counted (must have at least 2 entries)
synchronized (event) {
event.addTopic(result.references);
event.addTopic(result.references);
}
}
- Network.log.logInfo("remote search: peer " + target.getName() + " sent " + container.get(0).size() + "/" + result.totalCount + " references");
+ Network.log.info("remote search: peer " + target.getName() + " sent " + container.get(0).size() + "/" + result.totalCount + " references");
}
private static class SearchResult {
@@ -1039,7 +1039,7 @@ public final class Protocol {
rsp = event.getQuery().getSegment().fulltext().getDefaultConnector().getResponseByParams(solrQuery);
docList = rsp.getResults();
} catch (Throwable e) {
- Network.log.logInfo("SEARCH failed (solr), localpeer (" + e.getMessage() + ")", e);
+ Network.log.info("SEARCH failed (solr), localpeer (" + e.getMessage() + ")", e);
return -1;
}
} else {
@@ -1053,7 +1053,7 @@ public final class Protocol {
instance.close();
// no need to close this here because that sends a commit to remote solr which is not wanted here
} catch (Throwable e) {
- Network.log.logInfo("SEARCH failed (solr), remote Peer: " +target.getName() + "/" + target.getPublicAddress() + " (" + e.getMessage() + ")");
+ Network.log.info("SEARCH failed (solr), remote Peer: " +target.getName() + "/" + target.getPublicAddress() + " (" + e.getMessage() + ")");
return -1;
}
}
@@ -1095,11 +1095,11 @@ public final class Protocol {
// evaluate result
List<URIMetadataNode> container = new ArrayList<URIMetadataNode>();
if (docList == null || docList.size() == 0) {
- Network.log.logInfo("SEARCH (solr), returned 0 out of 0 documents from " + (target == null ? "shard" : ("peer " + target.hash + ":" + target.getName())) + " query = " + solrQuery.toString()) ;
+ Network.log.info("SEARCH (solr), returned 0 out of 0 documents from " + (target == null ? "shard" : ("peer " + target.hash + ":" + target.getName())) + " query = " + solrQuery.toString()) ;
return 0;
}
- Network.log.logInfo("SEARCH (solr), returned " + docList.size() + " out of " + docList.getNumFound() + " documents and " + facets.size() + " facets " + facets.keySet().toString() + " from " + (target == null ? "shard" : ("peer " + target.hash + ":" + target.getName())));
+ Network.log.info("SEARCH (solr), returned " + docList.size() + " out of " + docList.getNumFound() + " documents and " + facets.size() + " facets " + facets.keySet().toString() + " from " + (target == null ? "shard" : ("peer " + target.hash + ":" + target.getName())));
int term = count;
Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>(docList.size());
for (final SolrDocument doc: docList) {
@@ -1115,9 +1115,9 @@ public final class Protocol {
if ( blacklist.isListed(BlacklistType.SEARCH, urlEntry) ) {
if ( Network.log.isInfo() ) {
if (localsearch) {
- Network.log.logInfo("local search (solr): filtered blacklisted url " + urlEntry.url());
+ Network.log.info("local search (solr): filtered blacklisted url " + urlEntry.url());
} else {
- Network.log.logInfo("remote search (solr): filtered blacklisted url " + urlEntry.url() + " from " + (target == null ? "shard" : ("peer " + target.hash + ":" + target.getName())));
+ Network.log.info("remote search (solr): filtered blacklisted url " + urlEntry.url() + " from " + (target == null ? "shard" : ("peer " + target.hash + ":" + target.getName())));
}
}
continue; // block with blacklist
@@ -1127,9 +1127,9 @@ public final class Protocol {
if ( urlRejectReason != null ) {
if ( Network.log.isInfo() ) {
if (localsearch) {
- Network.log.logInfo("local search (solr): rejected url '" + urlEntry.url() + "' (" + urlRejectReason + ")");
+ Network.log.info("local search (solr): rejected url '" + urlEntry.url() + "' (" + urlRejectReason + ")");
} else {
- Network.log.logInfo("remote search (solr): rejected url '" + urlEntry.url() + "' (" + urlRejectReason + ") from peer " + target.getName());
+ Network.log.info("remote search (solr): rejected url '" + urlEntry.url() + "' (" + urlRejectReason + ") from peer " + target.getName());
}
}
continue; // reject url outside of our domain
@@ -1162,7 +1162,7 @@ public final class Protocol {
event.addNodes(container, facets, snippets, true, "localpeer", (int) docList.getNumFound());
event.addFinalize();
event.addExpectedRemoteReferences(-count);
- Network.log.logInfo("local search (solr): localpeer sent " + container.size() + "/" + docList.getNumFound() + " references");
+ Network.log.info("local search (solr): localpeer sent " + container.size() + "/" + docList.getNumFound() + " references");
} else {
for (SolrInputDocument doc: docs) {
event.query.getSegment().putDocumentInQueue(doc);
@@ -1171,7 +1171,7 @@ public final class Protocol {
event.addNodes(container, facets, snippets, false, target.getName() + "/" + target.hash, (int) docList.getNumFound());
event.addFinalize();
event.addExpectedRemoteReferences(-count);
- Network.log.logInfo("remote search (solr): peer " + target.getName() + " sent " + (container.size() == 0 ? 0 : container.size()) + "/" + docList.getNumFound() + " references");
+ Network.log.info("remote search (solr): peer " + target.getName() + " sent " + (container.size() == 0 ? 0 : container.size()) + "/" + docList.getNumFound() + " references");
}
final int dls = docList.size();
docList.clear();
@@ -1198,7 +1198,7 @@ public final class Protocol {
return result;
} catch ( final Exception e ) {
// most probably a network time-out exception
- Network.log.logWarning("yacyClient.permissionMessage error:" + e.getMessage());
+ Network.log.warn("yacyClient.permissionMessage error:" + e.getMessage());
return null;
}
}
@@ -1225,7 +1225,7 @@ public final class Protocol {
final Map<String, String> result = FileUtils.table(content);
return result;
} catch ( final Exception e ) {
- Network.log.logWarning("yacyClient.postMessage error:" + e.getMessage());
+ Network.log.warn("yacyClient.postMessage error:" + e.getMessage());
return null;
}
}
@@ -1295,7 +1295,7 @@ public final class Protocol {
return FileUtils.table(content);
} catch ( final Exception e ) {
// most probably a network time-out exception
- Network.log.logWarning("yacyClient.crawlReceipt error:" + e.getMessage());
+ Network.log.warn("yacyClient.crawlReceipt error:" + e.getMessage());
return null;
}
}
@@ -1328,7 +1328,7 @@ public final class Protocol {
entry = eenum.next();
if ( !urlRefs.has(entry.urlhash()) ) {
if ( Network.log.isFine() ) {
- Network.log.logFine("DEBUG transferIndex: to-send url hash '"
+ Network.log.fine("DEBUG transferIndex: to-send url hash '"
+ ASCII.String(entry.urlhash())
+ "' is not contained in urlCache");
}
@@ -1383,7 +1383,7 @@ public final class Protocol {
if ( urlRefs.has(key) ) urls[i] = segment.fulltext().getMetadata(key);
if ( urls[i] == null ) {
if ( Network.log.isFine() ) {
- Network.log.logFine("DEBUG transferIndex: requested url hash '"
+ Network.log.fine("DEBUG transferIndex: requested url hash '"
+ uhs[i]
+ "', unknownURL='"
+ uhss
@@ -1422,7 +1422,7 @@ public final class Protocol {
final int timeout) {
final String address = targetSeed.getPublicAddress();
if ( address == null ) {
- Network.log.logWarning("no address for transferRWI");
+ Network.log.warn("no address for transferRWI");
return null;
}
@@ -1479,7 +1479,7 @@ public final class Protocol {
result.put("indexPayloadSize", Integer.toString(entrypost.length()));
return result;
} catch ( final Exception e ) {
- Network.log.logInfo("yacyClient.transferRWI to " + address + " error: " + e.getMessage());
+ Network.log.info("yacyClient.transferRWI to " + address + " error: " + e.getMessage());
return null;
}
}
@@ -1536,7 +1536,7 @@ public final class Protocol {
result.put("urlPayloadSize", Integer.toString(urlPayloadSize));
return result;
} catch ( final Exception e ) {
- Network.log.logWarning("yacyClient.transferURL to " + address + " error: " + e.getMessage());
+ Network.log.warn("yacyClient.transferURL to " + address + " error: " + e.getMessage());
return null;
}
}
@@ -1564,7 +1564,7 @@ public final class Protocol {
false);
return FileUtils.table(content);
} catch ( final Exception e ) {
- Network.log.logWarning("yacyClient.getProfile error:" + e.getMessage());
+ Network.log.warn("yacyClient.getProfile error:" + e.getMessage());
return null;
}
}
@@ -1591,7 +1591,7 @@ public final class Protocol {
parts.put("object", UTF8.StringBody("host"));
final byte[] content = postToFile(target, "idx.json", parts, 30000);
if ( content == null || content.length == 0 ) {
- Network.log.logWarning("yacyClient.loadIDXHosts error: empty result");
+ Network.log.warn("yacyClient.loadIDXHosts error: empty result");
return null;
}
final JSONObject json =
@@ -1633,7 +1633,7 @@ public final class Protocol {
}
return index;
} catch ( final Exception e ) {
- Network.log.logWarning("yacyClient.loadIDXHosts error:" + e.getMessage());
+ Network.log.warn("yacyClient.loadIDXHosts error:" + e.getMessage());
return index;
}
}
diff --git a/source/net/yacy/peers/RemoteSearch.java b/source/net/yacy/peers/RemoteSearch.java
index 6cc1d32f5..8233cfc58 100644
--- a/source/net/yacy/peers/RemoteSearch.java
+++ b/source/net/yacy/peers/RemoteSearch.java
@@ -34,7 +34,7 @@ import org.apache.solr.client.solrj.SolrQuery;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.storage.HandleSet;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.repository.Blacklist;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
@@ -109,10 +109,10 @@ public class RemoteSearch extends Thread {
this.event.peers.mySeed().incRI(this.urls);
this.event.peers.mySeed().incRU(this.urls);
} else {
- Network.log.logInfo("REMOTE SEARCH - no answer from remote peer " + this.targetPeer.hash + ":" + this.targetPeer.getName());
+ Network.log.info("REMOTE SEARCH - no answer from remote peer " + this.targetPeer.hash + ":" + this.targetPeer.getName());
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
this.event.oneFeederTerminated();
}
@@ -206,7 +206,7 @@ public class RemoteSearch extends Thread {
rs.start();
event.primarySearchThreadsL.add(rs);
} catch (final OutOfMemoryError e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
break;
}
}
@@ -248,14 +248,14 @@ public class RemoteSearch extends Thread {
blacklist);
if (urls >= 0) {
// urls is an array of url hashes. this is only used for log output
- if (urlhashes != null && urlhashes.length() > 0) Network.log.logInfo("SECONDARY REMOTE SEARCH - remote peer " + targetPeer.hash + ":" + targetPeer.getName() + " contributed " + urls + " links for word hash " + wordhashes);
+ if (urlhashes != null && urlhashes.length() > 0) Network.log.info("SECONDARY REMOTE SEARCH - remote peer " + targetPeer.hash + ":" + targetPeer.getName() + " contributed " + urls + " links for word hash " + wordhashes);
event.peers.mySeed().incRI(urls);
event.peers.mySeed().incRU(urls);
} else {
- Network.log.logInfo("REMOTE SEARCH - no answer from remote peer " + targetPeer.hash + ":" + targetPeer.getName());
+ Network.log.info("REMOTE SEARCH - no answer from remote peer " + targetPeer.hash + ":" + targetPeer.getName());
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
event.oneFeederTerminated();
}
@@ -296,11 +296,11 @@ public class RemoteSearch extends Thread {
event.peers.mySeed().incRU(urls);
} else {
if (targetPeer != null) {
- Network.log.logInfo("REMOTE SEARCH - no answer from remote peer " + targetPeer.hash + ":" + targetPeer.getName());
+ Network.log.info("REMOTE SEARCH - no answer from remote peer " + targetPeer.hash + ":" + targetPeer.getName());
}
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
event.oneFeederTerminated();
}
diff --git a/source/net/yacy/peers/Seed.java b/source/net/yacy/peers/Seed.java
index 3cd0cb411..e32b261e1 100644
--- a/source/net/yacy/peers/Seed.java
+++ b/source/net/yacy/peers/Seed.java
@@ -941,7 +941,7 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
// this is the birthplace of a seed, that then will start to travel to other peers
final String hashs = ASCII.String(bestGap(db));
- Network.log.logInfo("init: OWN SEED = " + hashs);
+ Network.log.info("init: OWN SEED = " + hashs);
final Seed newSeed = new Seed(hashs);
diff --git a/source/net/yacy/peers/SeedDB.java b/source/net/yacy/peers/SeedDB.java
index ece0b79c1..4ecde739d 100644
--- a/source/net/yacy/peers/SeedDB.java
+++ b/source/net/yacy/peers/SeedDB.java
@@ -49,11 +49,11 @@ import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.http.HTTPClient;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.blob.MapDataMining;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.kelondroException;
import net.yacy.peers.operation.yacySeedUploader;
@@ -200,24 +200,24 @@ public final class SeedDB implements AlternativeDomainNames {
if (this.mySeed == null) throw new IOException("current seed is null");
} catch (final IOException e) {
// create new identity
- Log.logSevere("SEEDDB", "could not load stored mySeed.txt from " + this.myOwnSeedFile.toString() + ": " + e.getMessage() + ". creating new seed.", e);
+ ConcurrentLog.severe("SEEDDB", "could not load stored mySeed.txt from " + this.myOwnSeedFile.toString() + ": " + e.getMessage() + ". creating new seed.", e);
this.mySeed = Seed.genLocalSeed(this);
try {
this.mySeed.save(this.myOwnSeedFile);
} catch (final IOException ee) {
- Log.logSevere("SEEDDB", "error saving mySeed.txt (1) to " + this.myOwnSeedFile.toString() + ": " + ee.getMessage(), ee);
- Log.logException(ee);
+ ConcurrentLog.severe("SEEDDB", "error saving mySeed.txt (1) to " + this.myOwnSeedFile.toString() + ": " + ee.getMessage(), ee);
+ ConcurrentLog.logException(ee);
System.exit(-1);
}
} else {
// create new identity
- Log.logInfo("SEEDDB", "could not find stored mySeed.txt at " + this.myOwnSeedFile.toString() + ": " + ". creating new seed.");
+ ConcurrentLog.info("SEEDDB", "could not find stored mySeed.txt at " + this.myOwnSeedFile.toString() + ": " + ". creating new seed.");
this.mySeed = Seed.genLocalSeed(this);
try {
this.mySeed.save(this.myOwnSeedFile);
} catch (final IOException ee) {
- Log.logSevere("SEEDDB", "error saving mySeed.txt (2) to " + this.myOwnSeedFile.toString() + ": " + ee.getMessage(), ee);
- Log.logException(ee);
+ ConcurrentLog.severe("SEEDDB", "error saving mySeed.txt (2) to " + this.myOwnSeedFile.toString() + ": " + ee.getMessage(), ee);
+ ConcurrentLog.logException(ee);
System.exit(-1);
}
}
@@ -291,13 +291,13 @@ public final class SeedDB implements AlternativeDomainNames {
this.seedActiveDB.delete(mySeedHash);
this.seedPassiveDB.delete(mySeedHash);
this.seedPotentialDB.delete(mySeedHash);
- } catch (final IOException e) { Log.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
+ } catch (final IOException e) { ConcurrentLog.warn("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
}
public void saveMySeed() {
try {
mySeed().save(this.myOwnSeedFile);
- } catch (final IOException e) { Log.logWarning("yacySeedDB", "could not save mySeed '"+ this.myOwnSeedFile +"': "+ e.getMessage()); }
+ } catch (final IOException e) { ConcurrentLog.warn("yacySeedDB", "could not save mySeed '"+ this.myOwnSeedFile +"': "+ e.getMessage()); }
}
public boolean noDHTActivity() {
@@ -309,7 +309,7 @@ public final class SeedDB implements AlternativeDomainNames {
final File parentDir = new File(seedDBFile.getParent());
if (!parentDir.exists()) {
if(!parentDir.mkdirs())
- Log.logWarning("yacySeedDB", "could not create directories for "+ seedDBFile.getParent());
+ ConcurrentLog.warn("yacySeedDB", "could not create directories for "+ seedDBFile.getParent());
}
try {
return new MapDataMining(seedDBFile, Word.commonHashLength, Base64Order.enhancedCoder, 1024 * 512, 500, sortFields, longaccFields, doubleaccFields);
@@ -319,7 +319,7 @@ public final class SeedDB implements AlternativeDomainNames {
try {
return new MapDataMining(seedDBFile, Word.commonHashLength, Base64Order.enhancedCoder, 1024 * 512, 500, sortFields, longaccFields, doubleaccFields);
} catch (final IOException e1) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
System.exit(-1);
return null;
}
@@ -329,11 +329,11 @@ public final class SeedDB implements AlternativeDomainNames {
private synchronized MapDataMining resetSeedTable(MapDataMining seedDB, final File seedDBFile) {
// this is an emergency function that should only be used if any problem with the
// seed.db is detected
- Network.log.logWarning("seed-db " + seedDBFile.toString() + " reset (on-the-fly)");
+ Network.log.warn("seed-db " + seedDBFile.toString() + " reset (on-the-fly)");
seedDB.close();
FileUtils.deletedelete(seedDBFile);
if (seedDBFile.exists())
- Log.logWarning("yacySeedDB", "could not delete file "+ seedDBFile);
+ ConcurrentLog.warn("yacySeedDB", "could not delete file "+ seedDBFile);
// create new seed database
seedDB = openSeedTable(seedDBFile);
return seedDB;
@@ -394,7 +394,7 @@ public final class SeedDB implements AlternativeDomainNames {
hash = Seed.hexHash2b64Hash(yacydom.substring(0, yacydom.length() - 6));
seed = get(hash);
if (seed == null) {
- Network.log.logWarning("cluster peer '" + yacydom + "' was not found.");
+ Network.log.warn("cluster peer '" + yacydom + "' was not found.");
} else {
clustermap.put(ASCII.getBytes(hash), ipport);
}
@@ -402,12 +402,12 @@ public final class SeedDB implements AlternativeDomainNames {
// find a peer with its name
seed = lookupByName(yacydom.substring(0, yacydom.length() - 5));
if (seed == null) {
- Network.log.logWarning("cluster peer '" + yacydom + "' was not found.");
+ Network.log.warn("cluster peer '" + yacydom + "' was not found.");
} else {
clustermap.put(ASCII.getBytes(seed.hash), ipport);
}
} else {
- Network.log.logWarning("cluster peer '" + addresse + "' has wrong syntax. the name must end with .yacy or .yacyh");
+ Network.log.warn("cluster peer '" + addresse + "' has wrong syntax. the name must end with .yacy or .yacyh");
}
}
return clustermap;
@@ -487,7 +487,7 @@ public final class SeedDB implements AlternativeDomainNames {
this.seedPassiveDB.delete(ASCII.getBytes(seed.hash));
this.seedPotentialDB.delete(ASCII.getBytes(seed.hash));
} catch (final Exception e) {
- Network.log.logSevere("ERROR add: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ Network.log.severe("ERROR add: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
resetActiveTable();
}
}
@@ -499,13 +499,13 @@ public final class SeedDB implements AlternativeDomainNames {
try {
this.seedActiveDB.delete(ASCII.getBytes(seed.hash));
this.seedPotentialDB.delete(ASCII.getBytes(seed.hash));
- } catch (final Exception e) { Log.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
+ } catch (final Exception e) { ConcurrentLog.warn("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
//seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
try {
final ConcurrentMap<String, String> seedPropMap = seed.getMap();
this.seedPassiveDB.insert(ASCII.getBytes(seed.hash), seedPropMap);
} catch (final Exception e) {
- Network.log.logSevere("ERROR add: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ Network.log.severe("ERROR add: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
resetPassiveTable();
}
}
@@ -517,13 +517,13 @@ public final class SeedDB implements AlternativeDomainNames {
try {
this.seedActiveDB.delete(ASCII.getBytes(seed.hash));
this.seedPassiveDB.delete(ASCII.getBytes(seed.hash));
- } catch (final Exception e) { Log.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
+ } catch (final Exception e) { ConcurrentLog.warn("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
//seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
try {
final ConcurrentMap<String, String> seedPropMap = seed.getMap();
this.seedPotentialDB.insert(ASCII.getBytes(seed.hash), seedPropMap);
} catch (final Exception e) {
- Network.log.logSevere("ERROR add: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ Network.log.severe("ERROR add: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
resetPotentialTable();
}
}
@@ -533,14 +533,14 @@ public final class SeedDB implements AlternativeDomainNames {
if (peerHash == null) return;
try {
this.seedPassiveDB.delete(ASCII.getBytes(peerHash));
- } catch (final IOException e) { Log.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
+ } catch (final IOException e) { ConcurrentLog.warn("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
}
public synchronized void removePotential(final String peerHash) {
if (peerHash == null) return;
try {
this.seedPotentialDB.delete(ASCII.getBytes(peerHash));
- } catch (final IOException e) { Log.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
+ } catch (final IOException e) { ConcurrentLog.warn("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
}
public boolean hasConnected(final byte[] hash) {
@@ -564,10 +564,10 @@ public final class SeedDB implements AlternativeDomainNames {
if (map == null) return null;
entry.putAll(map);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
return new Seed(hash, entry);
@@ -600,13 +600,13 @@ public final class SeedDB implements AlternativeDomainNames {
}
final byte[] hashb = ASCII.getBytes(hash);
Seed s = get(hash, this.seedActiveDB);
- if (s != null) try { this.seedActiveDB.insert(hashb, seed.getMap()); return;} catch (final Exception e) {Log.logException(e);}
+ if (s != null) try { this.seedActiveDB.insert(hashb, seed.getMap()); return;} catch (final Exception e) {ConcurrentLog.logException(e);}
s = get(hash, this.seedPassiveDB);
- if (s != null) try { this.seedPassiveDB.insert(hashb, seed.getMap()); return;} catch (final Exception e) {Log.logException(e);}
+ if (s != null) try { this.seedPassiveDB.insert(hashb, seed.getMap()); return;} catch (final Exception e) {ConcurrentLog.logException(e);}
s = get(hash, this.seedPotentialDB);
- if (s != null) try { this.seedPotentialDB.insert(hashb, seed.getMap()); return;} catch (final Exception e) {Log.logException(e);}
+ if (s != null) try { this.seedPotentialDB.insert(hashb, seed.getMap()); return;} catch (final Exception e) {ConcurrentLog.logException(e);}
}
public Seed lookupByName(String peerName) {
@@ -786,15 +786,15 @@ public final class SeedDB implements AlternativeDomainNames {
// create a seed file which for uploading ...
seedFile = File.createTempFile("seedFile",".txt", seedDB.myOwnSeedFile.getParentFile());
seedFile.deleteOnExit();
- if (Network.log.isFine()) Network.log.logFine("SaveSeedList: Storing seedlist into tempfile " + seedFile.toString());
+ if (Network.log.isFine()) Network.log.fine("SaveSeedList: Storing seedlist into tempfile " + seedFile.toString());
final ArrayList<String> uv = storeSeedList(seedFile, true);
// uploading the seed file
- if (Network.log.isFine()) Network.log.logFine("SaveSeedList: Trying to upload seed-file, " + seedFile.length() + " bytes, " + uv.size() + " entries.");
+ if (Network.log.isFine()) Network.log.fine("SaveSeedList: Trying to upload seed-file, " + seedFile.length() + " bytes, " + uv.size() + " entries.");
log = uploader.uploadSeedFile(sb, seedFile);
// test download
- if (Network.log.isFine()) Network.log.logFine("SaveSeedList: Trying to download seed-file '" + seedURL + "'.");
+ if (Network.log.isFine()) Network.log.fine("SaveSeedList: Trying to download seed-file '" + seedURL + "'.");
final Iterator<String> check = downloadSeedFile(seedURL);
// Comparing if local copy and uploaded copy are equal
@@ -851,11 +851,11 @@ public final class SeedDB implements AlternativeDomainNames {
private static String checkCache(final ArrayList<String> uv, final Iterator<String> check) {
if ((check == null) || (uv == null)) {
- if (Network.log.isFine()) Network.log.logFine("SaveSeedList: Local and uploades seed-list are different");
+ if (Network.log.isFine()) Network.log.fine("SaveSeedList: Local and uploades seed-list are different");
return "Entry count is different: uv.size() = " + ((uv == null) ? "null" : Integer.toString(uv.size()));
}
- if (Network.log.isFine()) Network.log.logFine("SaveSeedList: Comparing local and uploades seed-list entries ...");
+ if (Network.log.isFine()) Network.log.fine("SaveSeedList: Comparing local and uploades seed-list entries ...");
int i = 0;
while (check.hasNext() && i < uv.size()) {
if (!((uv.get(i)).equals(check.next()))) return "Element at position " + i + " is different.";
@@ -954,14 +954,14 @@ public final class SeedDB implements AlternativeDomainNames {
if (version >= this.minVersion || version == 0.0) break; // include 0.0 to access always developer peers
}
} catch (final IOException e) {
- Log.logException(e);
- Network.log.logSevere("ERROR seedLinEnum: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ ConcurrentLog.logException(e);
+ Network.log.severe("ERROR seedLinEnum: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
if (database == SeedDB.this.seedActiveDB) SeedDB.this.seedActiveDB = resetSeedTable(SeedDB.this.seedActiveDB, SeedDB.this.seedActiveDBFile);
if (database == SeedDB.this.seedPassiveDB) SeedDB.this.seedPassiveDB = resetSeedTable(SeedDB.this.seedPassiveDB, SeedDB.this.seedPassiveDBFile);
this.it = null;
} catch (final kelondroException e) {
- Log.logException(e);
- Network.log.logSevere("ERROR seedLinEnum: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ ConcurrentLog.logException(e);
+ Network.log.severe("ERROR seedLinEnum: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
if (database == SeedDB.this.seedActiveDB) SeedDB.this.seedActiveDB = resetSeedTable(SeedDB.this.seedActiveDB, SeedDB.this.seedActiveDBFile);
if (database == SeedDB.this.seedPassiveDB) SeedDB.this.seedPassiveDB = resetSeedTable(SeedDB.this.seedPassiveDB, SeedDB.this.seedPassiveDBFile);
this.it = null;
@@ -974,8 +974,8 @@ public final class SeedDB implements AlternativeDomainNames {
this.it = database.entries(up, field);
this.nextSeed = internalNext();
} catch (final kelondroException e) {
- Log.logException(e);
- Network.log.logSevere("ERROR seedLinEnum: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ ConcurrentLog.logException(e);
+ Network.log.severe("ERROR seedLinEnum: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
if (database == SeedDB.this.seedActiveDB) SeedDB.this.seedActiveDB = resetSeedTable(SeedDB.this.seedActiveDB, SeedDB.this.seedActiveDBFile);
if (database == SeedDB.this.seedPassiveDB) SeedDB.this.seedPassiveDB = resetSeedTable(SeedDB.this.seedPassiveDB, SeedDB.this.seedPassiveDBFile);
if (database == SeedDB.this.seedPotentialDB) SeedDB.this.seedPotentialDB = resetSeedTable(SeedDB.this.seedPotentialDB, SeedDB.this.seedPotentialDBFile);
@@ -997,7 +997,7 @@ public final class SeedDB implements AlternativeDomainNames {
try {
dna0 = this.it.next();
} catch (final OutOfMemoryError e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
dna0 = null;
}
assert dna0 != null;
@@ -1014,8 +1014,8 @@ public final class SeedDB implements AlternativeDomainNames {
}
return null;
} catch (final Exception e) {
- Log.logException(e);
- Network.log.logSevere("ERROR internalNext: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
+ ConcurrentLog.logException(e);
+ Network.log.severe("ERROR internalNext: seed.db corrupt (" + e.getMessage() + "); resetting seed.db", e);
if (this.database == SeedDB.this.seedActiveDB) SeedDB.this.seedActiveDB = resetSeedTable(SeedDB.this.seedActiveDB, SeedDB.this.seedActiveDBFile);
if (this.database == SeedDB.this.seedPassiveDB) SeedDB.this.seedPassiveDB = resetSeedTable(SeedDB.this.seedPassiveDB, SeedDB.this.seedPassiveDBFile);
if (this.database == SeedDB.this.seedPotentialDB) SeedDB.this.seedPotentialDB = resetSeedTable(SeedDB.this.seedPotentialDB, SeedDB.this.seedPotentialDBFile);
@@ -1033,9 +1033,9 @@ public final class SeedDB implements AlternativeDomainNames {
version = this.nextSeed.getVersion();
if (version >= this.minVersion || version == 0.0) break; // include 0.0 to access always developer peers
}} catch (final kelondroException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
// emergency reset
- Network.log.logSevere("seed-db emergency reset", e);
+ Network.log.severe("seed-db emergency reset", e);
this.database.clear();
this.nextSeed = null;
return null;
diff --git a/source/net/yacy/peers/Transmission.java b/source/net/yacy/peers/Transmission.java
index a070612fa..9beafd8c3 100644
--- a/source/net/yacy/peers/Transmission.java
+++ b/source/net/yacy/peers/Transmission.java
@@ -34,12 +34,12 @@ import java.util.Set;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceContainerCache;
import net.yacy.kelondro.workflow.WorkflowJob;
@@ -51,14 +51,14 @@ public class Transmission {
// anything beyond that might get discarded without notice
public static final int maxRWIsCount = 1000; // since SVN 7993 hardcoded in htroot/yacy/transferRWI.java:161
- protected Log log;
+ protected ConcurrentLog log;
protected Segment segment;
protected SeedDB seeds;
protected boolean gzipBody4Transfer;
protected int timeout4Transfer;
public Transmission(
- final Log log,
+ final ConcurrentLog log,
final Segment segment,
final SeedDB seeds,
final boolean gzipBody4Transfer,
@@ -138,7 +138,7 @@ public class Transmission {
try {
Transmission.this.segment.storeRWI(container);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return c;
}
@@ -157,7 +157,7 @@ public class Transmission {
try {
Transmission.this.segment.storeRWI(container);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return;
}
@@ -243,10 +243,10 @@ public class Transmission {
// target is my own peer. This is easy. Just restore the indexContainer
restore();
this.hit++;
- Transmission.this.log.logInfo("Transfer of chunk to myself-target");
+ Transmission.this.log.info("Transfer of chunk to myself-target");
return true;
}
- Transmission.this.log.logInfo("starting new index transmission request to " + ASCII.String(this.primaryTarget));
+ Transmission.this.log.info("starting new index transmission request to " + ASCII.String(this.primaryTarget));
final long start = System.currentTimeMillis();
final String error = Protocol.transferIndex(target, this.containers, this.references, Transmission.this.segment, Transmission.this.gzipBody4Transfer, Transmission.this.timeout4Transfer);
if (error == null) {
@@ -254,7 +254,7 @@ public class Transmission {
final long transferTime = System.currentTimeMillis() - start;
final Iterator<ReferenceContainer<WordReference>> i = this.containers.iterator();
final ReferenceContainer<WordReference> firstContainer = (i == null) ? null : i.next();
- Transmission.this.log.logInfo("Index transfer of " + this.containers.size() +
+ Transmission.this.log.info("Index transfer of " + this.containers.size() +
" words [" + ((firstContainer == null) ? null : ASCII.String(firstContainer.getTermHash())) + " .. " + ASCII.String(this.primaryTarget) + "]" +
" and " + this.references.size() + " URLs" +
" to peer " + target.getName() + ":" + target.hash +
@@ -265,13 +265,13 @@ public class Transmission {
Transmission.this.seeds.mySeed().incSU(this.references.size());
// if the peer has set a pause time and we are in flush mode (index transfer)
// then we pause for a while now
- Transmission.this.log.logInfo("Transfer finished of chunk to target " + target.hash + "/" + target.getName());
+ Transmission.this.log.info("Transfer finished of chunk to target " + target.hash + "/" + target.getName());
this.hit++;
return true;
}
this.miss++;
// write information that peer does not receive index transmissions
- Transmission.this.log.logInfo("Transfer failed of chunk to target " + target.hash + "/" + target.getName() + ": " + error);
+ Transmission.this.log.info("Transfer failed of chunk to target " + target.hash + "/" + target.getName() + ": " + error);
// get possibly newer target Info
final Seed newTarget = Transmission.this.seeds.get(target.hash);
if (newTarget != null) {
@@ -302,7 +302,7 @@ public class Transmission {
for (final ReferenceContainer<WordReference> ic : this) try {
Transmission.this.segment.storeRWI(ic);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/peers/graphics/NetworkGraph.java b/source/net/yacy/peers/graphics/NetworkGraph.java
index 27a636db2..e60301e27 100644
--- a/source/net/yacy/peers/graphics/NetworkGraph.java
+++ b/source/net/yacy/peers/graphics/NetworkGraph.java
@@ -38,7 +38,7 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.Hit;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.federate.yacy.Distribution;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.peers.EventChannel;
import net.yacy.peers.RemoteSearch;
import net.yacy.peers.Seed;
@@ -225,7 +225,7 @@ public class NetworkGraph {
while (e.hasNext() && count < maxCount) {
seed = e.next();
if (seed == null) {
- Log.logWarning("NetworkGraph", "connected seed == null");
+ ConcurrentLog.warn("NetworkGraph", "connected seed == null");
continue;
}
if (seed.hash.startsWith("AD")) {//temporary patch
@@ -243,7 +243,7 @@ public class NetworkGraph {
while (e.hasNext() && count < maxCount) {
seed = e.next();
if (seed == null) {
- Log.logWarning("NetworkGraph", "disconnected seed == null");
+ ConcurrentLog.warn("NetworkGraph", "disconnected seed == null");
continue;
}
lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenUTC()) / 1000 / 60);
@@ -261,7 +261,7 @@ public class NetworkGraph {
while (e.hasNext() && count < maxCount) {
seed = e.next();
if (seed == null) {
- Log.logWarning("NetworkGraph", "potential seed == null");
+ ConcurrentLog.warn("NetworkGraph", "potential seed == null");
continue;
}
lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenUTC()) / 1000 / 60);
diff --git a/source/net/yacy/peers/graphics/OSMTile.java b/source/net/yacy/peers/graphics/OSMTile.java
index e9b681cc0..b06922cc4 100644
--- a/source/net/yacy/peers/graphics/OSMTile.java
+++ b/source/net/yacy/peers/graphics/OSMTile.java
@@ -36,10 +36,10 @@ import javax.imageio.ImageIO;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.protocol.ClientIdentification;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.retrieval.Response;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.snippet.TextSnippet;
import net.yacy.visualization.RasterPlotter;
@@ -116,7 +116,7 @@ public class OSMTile {
try {
entry = Switchboard.getSwitchboard().loader.load(Switchboard.getSwitchboard().loader.request(tileURL, false, false), CacheStrategy.IFEXIST, Integer.MAX_VALUE, null, TextSnippet.snippetMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
} catch (final IOException e) {
- Log.logWarning("OSMTile", "cannot load: " + e.getMessage());
+ ConcurrentLog.warn("OSMTile", "cannot load: " + e.getMessage());
return null;
}
tileb = entry.getContent();
diff --git a/source/net/yacy/peers/graphics/WebStructureGraph.java b/source/net/yacy/peers/graphics/WebStructureGraph.java
index f20f8f8f7..0bfcafc5f 100644
--- a/source/net/yacy/peers/graphics/WebStructureGraph.java
+++ b/source/net/yacy/peers/graphics/WebStructureGraph.java
@@ -50,13 +50,13 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.document.Document;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.AbstractReference;
import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.rwi.ReferenceContainer;
@@ -70,7 +70,7 @@ public class WebStructureGraph {
public static int maxref = 200; // maximum number of references, to avoid overflow when a large link farm occurs (i.e. wikipedia)
public static int maxhosts = 10000; // maximum number of hosts in web structure map
- private final static Log log = new Log("WebStructureGraph");
+ private final static ConcurrentLog log = new ConcurrentLog("WebStructureGraph");
private final File structureFile;
private final TreeMap<String, byte[]> structure_old; // <b64hash(6)>','<host> to <date-yyyymmdd(8)>{<target-b64hash(6)><target-count-hex(4)>}*
@@ -109,7 +109,7 @@ public class WebStructureGraph {
if ( loadedStructureB != null ) {
this.structure_old.putAll(loadedStructureB);
}
- log.logInfo("loaded dump of " + loadedStructureB.size() + " entries from " + this.structureFile.toString());
+ log.info("loaded dump of " + loadedStructureB.size() + " entries from " + this.structureFile.toString());
// delete out-dated entries in case the structure is too big
if ( this.structure_old.size() > maxhosts ) {
@@ -794,7 +794,7 @@ public class WebStructureGraph {
public synchronized void close() {
// finish dns resolving queue
if ( this.publicRefDNSResolvingWorker.isAlive() ) {
- log.logInfo("Waiting for the DNS Resolving Queue to terminate");
+ log.info("Waiting for the DNS Resolving Queue to terminate");
try {
this.publicRefDNSResolvingQueue.put(leanrefObjectPOISON);
this.publicRefDNSResolvingWorker.join(5000);
@@ -803,14 +803,14 @@ public class WebStructureGraph {
}
// save to web structure file
- log.logInfo("Saving Web Structure File: new = "
+ log.info("Saving Web Structure File: new = "
+ this.structure_new.size()
+ " entries, old = "
+ this.structure_old.size()
+ " entries");
final long time = System.currentTimeMillis();
joinOldNew();
- log.logInfo("dumping " + structure_old.size() + " entries to " + structureFile.toString());
+ log.info("dumping " + structure_old.size() + " entries to " + structureFile.toString());
if ( !this.structure_old.isEmpty() ) {
synchronized ( this.structure_old ) {
if ( !this.structure_old.isEmpty() ) {
@@ -820,7 +820,7 @@ public class WebStructureGraph {
this.structure_old,
"Web Structure Syntax: <b64hash(6)>','<host> to <date-yyyymmdd(8)>{<target-b64hash(6)><target-count-hex(4)>}*");
final long t = Math.max(1, System.currentTimeMillis() - time);
- log.logInfo("Saved Web Structure File: "
+ log.info("Saved Web Structure File: "
+ this.structure_old.size()
+ " entries in "
+ t
diff --git a/source/net/yacy/peers/operation/yacyRelease.java b/source/net/yacy/peers/operation/yacyRelease.java
index c627581ec..18e24f38f 100644
--- a/source/net/yacy/peers/operation/yacyRelease.java
+++ b/source/net/yacy/peers/operation/yacyRelease.java
@@ -52,12 +52,12 @@ import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.storage.Files;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.document.Document;
import net.yacy.document.parser.tarParser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.CharBuffer;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.OS;
import net.yacy.peers.Network;
@@ -108,14 +108,14 @@ public final class yacyRelease extends yacyVersion {
// check if release was installed by packagemanager
if (yacyBuildProperties.isPkgManager()) {
- Network.log.logInfo("rulebasedUpdateInfo: package manager is used for update");
+ Network.log.info("rulebasedUpdateInfo: package manager is used for update");
return null;
}
// check if update process allows update retrieve
final String process = sb.getConfig("update.process", "manual");
if ((!manual) && (!process.equals("auto"))) {
- Network.log.logInfo("rulebasedUpdateInfo: not an automatic update selected");
+ Network.log.info("rulebasedUpdateInfo: not an automatic update selected");
return null; // no, its a manual or guided process
}
@@ -123,7 +123,7 @@ public final class yacyRelease extends yacyVersion {
final long cycle = Math.max(1, sb.getConfigLong("update.cycle", 168)) * 60 * 60 * 1000; // update.cycle is hours
final long timeLookup = sb.getConfigLong("update.time.lookup", System.currentTimeMillis());
if ((!manual) && (timeLookup + cycle > System.currentTimeMillis())) {
- Network.log.logInfo("rulebasedUpdateInfo: too early for a lookup for a new release (timeLookup = " + timeLookup + ", cycle = " + cycle + ", now = " + System.currentTimeMillis() + ")");
+ Network.log.info("rulebasedUpdateInfo: too early for a lookup for a new release (timeLookup = " + timeLookup + ", cycle = " + cycle + ", now = " + System.currentTimeMillis() + ")");
return null; // no we have recently made a lookup
}
@@ -146,7 +146,7 @@ public final class yacyRelease extends yacyVersion {
(!(Double.toString(latestdev.getReleaseNr()).matches(blacklist)))) {
// consider a dev-release
if (latestdev.compareTo(thisVersion()) <= 0) {
- Network.log.logInfo(
+ Network.log.info(
"rulebasedUpdateInfo: latest dev " + latestdev.getName() +
" is not more recent than installed release " + thisVersion().getName());
return null;
@@ -156,13 +156,13 @@ public final class yacyRelease extends yacyVersion {
if (latestmain != null) {
// consider a main release
if ((Double.toString(latestmain.getReleaseNr()).matches(blacklist))) {
- Network.log.logInfo(
+ Network.log.info(
"rulebasedUpdateInfo: latest dev " + (latestdev == null ? "null" : latestdev.getName()) +
" matches with blacklist '" + blacklist + "'");
return null;
}
if (latestmain.compareTo(thisVersion()) <= 0) {
- Network.log.logInfo(
+ Network.log.info(
"rulebasedUpdateInfo: latest main " + latestmain.getName() +
" is not more recent than installed release (1) " + thisVersion().getName());
return null;
@@ -173,20 +173,20 @@ public final class yacyRelease extends yacyVersion {
if ((concept.equals("main")) && (latestmain != null)) {
// return a main-release
if ((Double.toString(latestmain.getReleaseNr()).matches(blacklist))) {
- Network.log.logInfo(
+ Network.log.info(
"rulebasedUpdateInfo: latest main " + latestmain.getName() +
" matches with blacklist'" + blacklist + "'");
return null;
}
if (latestmain.compareTo(thisVersion()) <= 0) {
- Network.log.logInfo(
+ Network.log.info(
"rulebasedUpdateInfo: latest main " + latestmain.getName() +
" is not more recent than installed release (2) " + thisVersion().getName());
return null;
}
return latestmain;
}
- Network.log.logInfo("rulebasedUpdateInfo: failed to find more recent release");
+ Network.log.info("rulebasedUpdateInfo: failed to find more recent release");
return null;
}
@@ -296,7 +296,7 @@ public final class yacyRelease extends yacyVersion {
if (this.publicKey != null) {
final byte[] signatureData = client.GETbytes(getUrl().toString() + ".sig");
if (signatureData == null) {
- Log.logWarning("yacyVersion", "download of signature " + getUrl().toString() + " failed. ignoring signature file.");
+ ConcurrentLog.warn("yacyVersion", "download of signature " + getUrl().toString() + " failed. ignoring signature file.");
}
else signatureBytes = Base64Order.standardCoder.decode(UTF8.String(signatureData).trim());
}
@@ -345,17 +345,17 @@ public final class yacyRelease extends yacyVersion {
}
} catch (final IOException e) {
// Saving file failed, abort download
- Log.logSevere("yacyVersion", "download of " + getName() + " failed: " + e.getMessage());
+ ConcurrentLog.severe("yacyVersion", "download of " + getName() + " failed: " + e.getMessage());
if (download != null && download.exists()) {
FileUtils.deletedelete(download);
- if (download.exists()) Log.logWarning("yacyVersion", "could not delete file "+ download);
+ if (download.exists()) ConcurrentLog.warn("yacyVersion", "could not delete file "+ download);
}
download = null;
} finally {
try {
client.finish();
} catch (final IOException e) {
- Log.logSevere("yacyVersion", "finish of " + getName() + " failed: " + e.getMessage());
+ ConcurrentLog.severe("yacyVersion", "finish of " + getName() + " failed: " + e.getMessage());
}
}
this.releaseFile = download;
@@ -401,7 +401,7 @@ public final class yacyRelease extends yacyVersion {
if (startType.exists()) starterFile = "startYACY.bat"; // startType noconsole
if (startParameter.startsWith("-gui")) starterFile += " " + startParameter;
try{
- Log.logInfo("RESTART", "INITIATED");
+ ConcurrentLog.info("RESTART", "INITIATED");
final String script =
"@echo off" + serverCore.LF_STRING +
"title YaCy restarter" + serverCore.LF_STRING +
@@ -418,34 +418,34 @@ public final class yacyRelease extends yacyVersion {
"start /MIN CMD /C " + starterFile + serverCore.LF_STRING;
final File scriptFile = new File(sb.getDataPath(), "DATA/RELEASE/restart.bat".replace("/", File.separator));
OS.deployScript(scriptFile, script);
- Log.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
+ ConcurrentLog.info("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
OS.execAsynchronous(scriptFile);
- Log.logInfo("RESTART", "script is running");
+ ConcurrentLog.info("RESTART", "script is running");
sb.terminate(10, "windows restart");
} catch (final IOException e) {
- Log.logSevere("RESTART", "restart failed", e);
+ ConcurrentLog.severe("RESTART", "restart failed", e);
}
}
if (yacyBuildProperties.isPkgManager()) {
// start a re-start daemon
try {
- Log.logInfo("RESTART", "INITIATED");
+ ConcurrentLog.info("RESTART", "INITIATED");
final String script =
"#!/bin/sh" + serverCore.LF_STRING +
yacyBuildProperties.getRestartCmd() + " >/var/lib/yacy/RELEASE/log" + serverCore.LF_STRING;
final File scriptFile = new File(sb.getDataPath(), "DATA/RELEASE/restart.sh");
OS.deployScript(scriptFile, script);
- Log.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
+ ConcurrentLog.info("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
OS.execAsynchronous(scriptFile);
- Log.logInfo("RESTART", "script is running");
+ ConcurrentLog.info("RESTART", "script is running");
} catch (final IOException e) {
- Log.logSevere("RESTART", "restart failed", e);
+ ConcurrentLog.severe("RESTART", "restart failed", e);
}
} else if (OS.canExecUnix) {
// start a re-start daemon
try {
- Log.logInfo("RESTART", "INITIATED");
+ ConcurrentLog.info("RESTART", "INITIATED");
final String script =
"#!/bin/sh" + serverCore.LF_STRING +
"cd " + sb.getDataPath() + "/DATA/RELEASE/" + serverCore.LF_STRING +
@@ -457,12 +457,12 @@ public final class yacyRelease extends yacyVersion {
"nohup ./startYACY.sh " + (startParameter.startsWith("-gui") ? startParameter : "") + " > /dev/null" + serverCore.LF_STRING;
final File scriptFile = new File(sb.getDataPath(), "DATA/RELEASE/restart.sh");
OS.deployScript(scriptFile, script);
- Log.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
+ ConcurrentLog.info("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
OS.execAsynchronous(scriptFile);
- Log.logInfo("RESTART", "script is running");
+ ConcurrentLog.info("RESTART", "script is running");
sb.terminate(10, "unix restart");
} catch (final IOException e) {
- Log.logSevere("RESTART", "restart failed", e);
+ ConcurrentLog.severe("RESTART", "restart failed", e);
}
}
}
@@ -477,11 +477,11 @@ public final class yacyRelease extends yacyVersion {
}
try {
final Switchboard sb = Switchboard.getSwitchboard();
- Log.logInfo("UPDATE", "INITIATED");
+ ConcurrentLog.info("UPDATE", "INITIATED");
try{
tarTools.unTar(tarTools.getInputStream(releaseFile), sb.getDataPath() + "/DATA/RELEASE/".replace("/", File.separator));
} catch (final Exception e){
- Log.logSevere("UNTAR", "failed", e);
+ ConcurrentLog.severe("UNTAR", "failed", e);
}
String script = null;
String scriptFileName = null;
@@ -491,7 +491,7 @@ public final class yacyRelease extends yacyVersion {
final File InfoPlistDestination = new File(sb.getAppPath(), "addon/YaCy.app/Contents/Info.plist");
if (InfoPlistSource.exists() && InfoPlistDestination.exists()) {
Files.copy(InfoPlistSource, InfoPlistDestination);
- Log.logInfo("UPDATE", "replaced Info.plist");
+ ConcurrentLog.info("UPDATE", "replaced Info.plist");
}
}
if (OS.isWindows) {
@@ -551,13 +551,13 @@ public final class yacyRelease extends yacyVersion {
}
final File scriptFile = new File(sb.getDataPath(), "DATA/RELEASE/".replace("/", File.separator) + scriptFileName);
OS.deployScript(scriptFile, script);
- Log.logInfo("UPDATE", "wrote update-script to " + scriptFile.getAbsolutePath());
+ ConcurrentLog.info("UPDATE", "wrote update-script to " + scriptFile.getAbsolutePath());
OS.execAsynchronous(scriptFile);
- Log.logInfo("UPDATE", "script is running");
+ ConcurrentLog.info("UPDATE", "script is running");
sb.setConfig("update.time.deploy", System.currentTimeMillis());
sb.terminate(10, "auto-deploy for " + releaseFile.getName());
} catch (final IOException e) {
- Log.logSevere("UPDATE", "update failed", e);
+ ConcurrentLog.severe("UPDATE", "update failed", e);
}
}
@@ -596,7 +596,7 @@ public final class yacyRelease extends yacyVersion {
// if we have some files
if (!downloadedreleases.isEmpty()) {
- Log.logFine("STARTUP", "deleting downloaded releases older than "+ deleteAfterDays +" days");
+ ConcurrentLog.fine("STARTUP", "deleting downloaded releases older than "+ deleteAfterDays +" days");
// keep latest version
final yacyVersion latest = downloadedreleases.last();
@@ -627,7 +627,7 @@ public final class yacyRelease extends yacyVersion {
FileUtils.deletedelete(downloadedFile);
FileUtils.deletedelete(new File(downloadedFile.getAbsolutePath() + ".sig"));
if (downloadedFile.exists()) {
- Log.logWarning("STARTUP", "cannot delete old release " + downloadedFile.getAbsolutePath());
+ ConcurrentLog.warn("STARTUP", "cannot delete old release " + downloadedFile.getAbsolutePath());
}
}
}
diff --git a/source/net/yacy/peers/operation/yacyVersion.java b/source/net/yacy/peers/operation/yacyVersion.java
index 85beb0ef7..060e64ad9 100644
--- a/source/net/yacy/peers/operation/yacyVersion.java
+++ b/source/net/yacy/peers/operation/yacyVersion.java
@@ -3,7 +3,7 @@ package net.yacy.peers.operation;
import java.util.Comparator;
import java.util.regex.Matcher;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
@@ -148,7 +148,7 @@ public class yacyVersion implements Comparator<yacyVersion>, Comparable<yacyVers
public static String[] combined2prettyVersion(final String ver, final String computerName) {
final Matcher matcher = yacyBuildProperties.versionMatcher.matcher(ver);
if (!matcher.find()) {
- Log.logWarning("STARTUP", "Peer '"+computerName+"': wrong format of version-string: '" + ver + "'. Using default string 'dev/00000' instead");
+ ConcurrentLog.warn("STARTUP", "Peer '"+computerName+"': wrong format of version-string: '" + ver + "'. Using default string 'dev/00000' instead");
return new String[]{"dev", "0000"};
}
diff --git a/source/net/yacy/repository/Blacklist.java b/source/net/yacy/repository/Blacklist.java
index 85f0d3ba5..73e469fb6 100644
--- a/source/net/yacy/repository/Blacklist.java
+++ b/source/net/yacy/repository/Blacklist.java
@@ -46,13 +46,13 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ListManager;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.SetTools;
import net.yacy.search.Switchboard;
@@ -121,14 +121,14 @@ public class Blacklist {
* Close (shutdown) this "sub-system", add more here for shutdown.
*/
public final synchronized void close() {
- Log.logFine("Blacklist", "Shutting down blacklists ...");
+ ConcurrentLog.fine("Blacklist", "Shutting down blacklists ...");
// Save cache
for (final BlacklistType blacklistType : BlacklistType.values()) {
saveDHTCache(blacklistType);
}
- Log.logFine("Blacklist", "All blacklists has been shutdown.");
+ ConcurrentLog.fine("Blacklist", "All blacklists has been shutdown.");
}
public final void setRootPath(final File rootPath) {
@@ -237,7 +237,7 @@ public class Blacklist {
}
if (a.indexOf("?*", 0) > 0) {
// prevent "Dangling meta character '*'" exception
- Log.logWarning("Blacklist", "ignored blacklist path to prevent 'Dangling meta character' exception: " + a);
+ ConcurrentLog.warn("Blacklist", "ignored blacklist path to prevent 'Dangling meta character' exception: " + a);
continue;
}
loadedPathsPattern.add(Pattern.compile("(?i)" + a)); // add case insesitive regex
@@ -360,13 +360,13 @@ public class Blacklist {
pw.println(pattern);
pw.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
if (pw != null) {
try {
pw.close();
} catch (final Exception e) {
- Log.logWarning("Blacklist", "could not close stream to " +
+ ConcurrentLog.warn("Blacklist", "could not close stream to " +
getFileName(blacklistType) + "! " + e.getMessage());
}
@@ -440,7 +440,7 @@ public class Blacklist {
try {
urlHashCache.put(url.hash());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.cachedUrlHashs.put(blacklistType, urlHashCache);
}
@@ -451,7 +451,7 @@ public class Blacklist {
try {
urlHashCache.put(url.hash());
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return temp;
@@ -642,7 +642,7 @@ public class Blacklist {
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -656,7 +656,7 @@ public class Blacklist {
in.close();
return;
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
this.cachedUrlHashs.put(type, new RowHandleSet(URIMetadataRow.rowdef.primaryKeyLength, URIMetadataRow.rowdef.objectOrder, 0));
diff --git a/source/net/yacy/repository/FilterEngine.java b/source/net/yacy/repository/FilterEngine.java
index 62b17af11..be34989f5 100644
--- a/source/net/yacy/repository/FilterEngine.java
+++ b/source/net/yacy/repository/FilterEngine.java
@@ -12,8 +12,8 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import net.yacy.cora.storage.HashARC;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
/**
* a URL filter engine for black and white lists
@@ -153,7 +153,7 @@ public class FilterEngine {
for(final FilterEntry e: app) {
if (e.path.indexOf("?*",0) > 0) {
// prevent "Dangling meta character '*'" exception
- Log.logWarning("FilterEngine", "ignored blacklist path to prevent 'Dangling meta character' exception: " + e);
+ ConcurrentLog.warn("FilterEngine", "ignored blacklist path to prevent 'Dangling meta character' exception: " + e);
continue;
}
if((e.path.equals("*")) || (path.matches(e.path)))
diff --git a/source/net/yacy/repository/LoaderDispatcher.java b/source/net/yacy/repository/LoaderDispatcher.java
index 0453d3b1b..603cff76c 100644
--- a/source/net/yacy/repository/LoaderDispatcher.java
+++ b/source/net/yacy/repository/LoaderDispatcher.java
@@ -45,6 +45,7 @@ import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.ZURL.FailCategory;
@@ -58,7 +59,6 @@ import net.yacy.document.Document;
import net.yacy.document.Parser;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
@@ -75,14 +75,14 @@ public final class LoaderDispatcher {
private final SMBLoader smbLoader;
private final FileLoader fileLoader;
private final ConcurrentHashMap<DigestURI, Semaphore> loaderSteering; // a map that delivers a 'finish' semaphore for urls
- private final Log log;
+ private final ConcurrentLog log;
public LoaderDispatcher(final Switchboard sb) {
this.sb = sb;
this.supportedProtocols = new HashSet<String>(Arrays.asList(new String[]{"http","https","ftp","smb","file"}));
// initiate loader objects
- this.log = new Log("LOADER");
+ this.log = new ConcurrentLog("LOADER");
this.httpLoader = new HTTPLoader(sb, this.log);
this.ftpLoader = new FTPLoader(sb, this.log);
this.smbLoader = new SMBLoader(sb, this.log);
@@ -223,7 +223,7 @@ public final class LoaderDispatcher {
// well, just take the cache and don't care about freshness of the content
final byte[] content = Cache.getContent(url.hash());
if (content != null) {
- this.log.logInfo("cache hit/useall for: " + url.toNormalform(true));
+ this.log.info("cache hit/useall for: " + url.toNormalform(true));
response.setContent(content);
return response;
}
@@ -234,14 +234,14 @@ public final class LoaderDispatcher {
if (response.isFreshForProxy()) {
final byte[] content = Cache.getContent(url.hash());
if (content != null) {
- this.log.logInfo("cache hit/fresh for: " + url.toNormalform(true));
+ this.log.info("cache hit/fresh for: " + url.toNormalform(true));
response.setContent(content);
return response;
}
}
- this.log.logInfo("cache hit/stale for: " + url.toNormalform(true));
+ this.log.info("cache hit/stale for: " + url.toNormalform(true));
} else if (cachedResponse != null) {
- this.log.logWarning("HTCACHE contained response header, but not content for url " + url.toNormalform(true));
+ this.log.warn("HTCACHE contained response header, but not content for url " + url.toNormalform(true));
}
}
@@ -265,7 +265,7 @@ public final class LoaderDispatcher {
cleanupAccessTimeTable(untilTime);
if (System.currentTimeMillis() < untilTime) {
long frcdslp = untilTime - System.currentTimeMillis();
- this.log.logInfo("Forcing sleep of " + frcdslp + " ms for host " + host);
+ this.log.info("Forcing sleep of " + frcdslp + " ms for host " + host);
try {Thread.sleep(frcdslp);} catch (final InterruptedException ee) {}
}
}
@@ -309,10 +309,10 @@ public final class LoaderDispatcher {
try {
Cache.store(url, response.getResponseHeader(), response.getContent());
} catch (final IOException e) {
- this.log.logWarning("cannot write " + response.url() + " to Cache (3): " + e.getMessage(), e);
+ this.log.warn("cannot write " + response.url() + " to Cache (3): " + e.getMessage(), e);
}
} else {
- this.log.logWarning("cannot write " + response.url() + " to Cache (4): " + storeError);
+ this.log.warn("cannot write " + response.url() + " to Cache (4): " + storeError);
}
return response;
}
diff --git a/source/net/yacy/search/MemoryTracker.java b/source/net/yacy/search/MemoryTracker.java
index de30394b9..c31f338f1 100644
--- a/source/net/yacy/search/MemoryTracker.java
+++ b/source/net/yacy/search/MemoryTracker.java
@@ -26,7 +26,7 @@
package net.yacy.search;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
public class MemoryTracker extends Thread {
@@ -61,7 +61,7 @@ public class MemoryTracker extends Thread {
}
}
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/search/ResourceObserver.java b/source/net/yacy/search/ResourceObserver.java
index 5a5afab8c..f6982dc0f 100644
--- a/source/net/yacy/search/ResourceObserver.java
+++ b/source/net/yacy/search/ResourceObserver.java
@@ -28,13 +28,13 @@ import java.io.File;
import net.yacy.cora.document.WordCache;
import net.yacy.cora.protocol.Domains;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.search.query.SearchEventCache;
public class ResourceObserver {
- public static final Log log = new Log("RESOURCE OBSERVER");
+ public static final ConcurrentLog log = new ConcurrentLog("RESOURCE OBSERVER");
// return values for available disk/memory
public enum Space implements Comparable<Space> {
@@ -50,7 +50,7 @@ public class ResourceObserver {
public ResourceObserver(final Switchboard sb) {
this.sb = sb;
this.path = sb.getDataPath(SwitchboardConstants.INDEX_PRIMARY_PATH, "");
- log.logInfo("path for disc space measurement: " + this.path);
+ log.info("path for disc space measurement: " + this.path);
}
public static void initThread() {
@@ -73,16 +73,16 @@ public class ResourceObserver {
if (this.normalizedDiskFree.compareTo(Space.HIGH) < 0) reason += " not enough disk space, " + this.path.getUsableSpace();
if (this.normalizedMemoryFree.compareTo(Space.HIGH) < 0 ) reason += " not enough memory space";
if (!this.sb.crawlJobIsPaused(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL)) {
- log.logInfo("pausing local crawls");
+ log.info("pausing local crawls");
this.sb.pauseCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL, "resource observer:" + reason);
}
if (!this.sb.crawlJobIsPaused(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL)) {
- log.logInfo("pausing remote triggered crawls");
+ log.info("pausing remote triggered crawls");
this.sb.pauseCrawlJob(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL, "resource observer:" + reason);
}
if ((this.normalizedDiskFree == Space.LOW || this.normalizedMemoryFree.compareTo(Space.HIGH) < 0) && this.sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false)) {
- log.logInfo("disabling index receive");
+ log.info("disabling index receive");
this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false);
this.sb.peers.mySeed().setFlagAcceptRemoteIndex(false);
this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true);
@@ -100,12 +100,12 @@ public class ResourceObserver {
else {
if(this.sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, false)) { // we were wrong!
- log.logInfo("enabling index receive");
+ log.info("enabling index receive");
this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true);
this.sb.peers.mySeed().setFlagAcceptRemoteIndex(true);
this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, false);
}
- log.logInfo("resources ok");
+ log.info("resources ok");
}
}
@@ -124,11 +124,11 @@ public class ResourceObserver {
Space ret = Space.HIGH;
if (currentSpace < getMinFreeDiskSpace()) {
- log.logWarning("Volume " + this.path.toString() + ": free space (" + (currentSpace / 1024 / 1024) + " MB) is low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)");
+ log.warn("Volume " + this.path.toString() + ": free space (" + (currentSpace / 1024 / 1024) + " MB) is low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)");
ret = Space.MEDIUM;
}
if (currentSpace < getMinFreeDiskSpace_hardlimit()) {
- log.logWarning("Volume " + this.path.toString() + ": free space (" + (currentSpace / 1024 / 1024) + " MB) is too low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)");
+ log.warn("Volume " + this.path.toString() + ": free space (" + (currentSpace / 1024 / 1024) + " MB) is too low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)");
ret = Space.LOW;
}
return ret;
diff --git a/source/net/yacy/search/Shutdown.java b/source/net/yacy/search/Shutdown.java
index b139f398f..521b93e41 100644
--- a/source/net/yacy/search/Shutdown.java
+++ b/source/net/yacy/search/Shutdown.java
@@ -20,7 +20,7 @@
package net.yacy.search;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class Shutdown extends Thread {
private final Switchboard sb;
@@ -38,9 +38,9 @@ public class Shutdown extends Thread {
try {
Thread.sleep(this.delay);
} catch ( final InterruptedException e ) {
- this.sb.getLog().logInfo("interrupted delayed shutdown");
+ this.sb.getLog().info("interrupted delayed shutdown");
} catch ( final Exception e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
this.sb.terminate(this.reason);
}
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index 02c0b9b37..4d7d76e60 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -112,6 +112,7 @@ import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.TimeoutRequest;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.protocol.http.ProxySettings;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.CrawlStacker;
import net.yacy.crawler.CrawlSwitchboard;
import net.yacy.crawler.HarvestProcess;
@@ -156,7 +157,6 @@ import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.Word;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -299,7 +299,7 @@ public final class Switchboard extends serverSwitch {
MemoryTracker.startSystemProfiling();
// set loglevel and log
- setLog(new Log("SWITCHBOARD"));
+ setLog(new ConcurrentLog("SWITCHBOARD"));
AccessTracker.setDumpFile(new File("DATA/LOG/queries.log"));
// set default peer name
@@ -329,13 +329,13 @@ public final class Switchboard extends serverSwitch {
// load values from configs
final File indexPath =
getDataPath(SwitchboardConstants.INDEX_PRIMARY_PATH, SwitchboardConstants.INDEX_PATH_DEFAULT);
- this.log.logConfig("Index Primary Path: " + indexPath.toString());
+ this.log.config("Index Primary Path: " + indexPath.toString());
this.listsPath =
getDataPath(SwitchboardConstants.LISTS_PATH, SwitchboardConstants.LISTS_PATH_DEFAULT);
- this.log.logConfig("Lists Path: " + this.listsPath.toString());
+ this.log.config("Lists Path: " + this.listsPath.toString());
this.htDocsPath =
getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT);
- this.log.logConfig("HTDOCS Path: " + this.htDocsPath.toString());
+ this.log.config("HTDOCS Path: " + this.htDocsPath.toString());
this.workPath = getDataPath(SwitchboardConstants.WORK_PATH, SwitchboardConstants.WORK_PATH_DEFAULT);
this.workPath.mkdirs();
// if default work files exist, copy them (don't overwrite existing!)
@@ -347,21 +347,21 @@ public final class Switchboard extends serverSwitch {
try {
Files.copy(new File(defaultWorkPath, fs), wf);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
}
- this.log.logConfig("Work Path: " + this.workPath.toString());
+ this.log.config("Work Path: " + this.workPath.toString());
this.dictionariesPath =
getDataPath(
SwitchboardConstants.DICTIONARY_SOURCE_PATH,
SwitchboardConstants.DICTIONARY_SOURCE_PATH_DEFAULT);
- this.log.logConfig("Dictionaries Path:" + this.dictionariesPath.toString());
+ this.log.config("Dictionaries Path:" + this.dictionariesPath.toString());
// init libraries
- this.log.logConfig("initializing libraries");
+ this.log.config("initializing libraries");
new Thread() {
@Override
public void run() {
@@ -375,7 +375,7 @@ public final class Switchboard extends serverSwitch {
// init sessionid name file
final String sessionidNamesFile = getConfig("sessionidNamesFile", "defaults/sessionid.names");
- this.log.logConfig("Loading sessionid file " + sessionidNamesFile);
+ this.log.config("Loading sessionid file " + sessionidNamesFile);
MultiProtocolURI.initSessionIDNames(FileUtils.loadList(new File(getAppPath(), sessionidNamesFile)));
// init tables
@@ -389,13 +389,13 @@ public final class Switchboard extends serverSwitch {
try {
overwriteNetworkDefinition();
} catch (FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// start indexing management
- this.log.logConfig("Starting Indexing Management");
+ this.log.config("Starting Indexing Management");
final String networkName = getConfig(SwitchboardConstants.NETWORK_NAME, "");
final long fileSizeMax = (OS.isWindows) ? this.getConfigLong("filesize.max.win", Integer.MAX_VALUE) : this.getConfigLong( "filesize.max.other", Integer.MAX_VALUE);
final int redundancy = (int) this.getConfigLong("network.unit.dhtredundancy.senior", 1);
@@ -420,7 +420,7 @@ public final class Switchboard extends serverSwitch {
// initialize the collection schema if it does not yet exist
if (!solrCollectionConfigurationWorkFile.exists()) try {
Files.copy(solrCollectionConfigurationInitFile, solrCollectionConfigurationWorkFile);
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
// lazy definition of schema: do not write empty fields
final boolean solrlazy = getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_LAZY, true);
@@ -447,12 +447,12 @@ public final class Switchboard extends serverSwitch {
// activate some fields that are necessary here
solrCollectionConfigurationWork.get(CollectionSchema.images_urlstub_sxt.getSolrFieldName()).setEnable(true);
solrCollectionConfigurationWork.commit();
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
// initialize the webgraph schema if it does not yet exist
if (!solrWebgraphConfigurationWorkFile.exists()) try {
Files.copy(solrWebgraphConfigurationInitFile, solrWebgraphConfigurationWorkFile);
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
// define webgraph schema
try {
@@ -460,7 +460,7 @@ public final class Switchboard extends serverSwitch {
solrWebgraphConfigurationWork = new WebgraphConfiguration(solrWebgraphConfigurationWorkFile, solrlazy);
solrWebgraphConfigurationWork.fill(solrWebgraphConfigurationInit, true);
solrWebgraphConfigurationWork.commit();
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
// define boosts
Ranking.setMinTokenLen(this.getConfigInt(SwitchboardConstants.SEARCH_RANKING_SOLR_DOUBLEDETECTION_MINLENGTH, 3));
@@ -480,13 +480,13 @@ public final class Switchboard extends serverSwitch {
this.index = new Segment(this.log, segmentsPath, solrCollectionConfigurationWork, solrWebgraphConfigurationWork);
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_RWI, true)) try {
this.index.connectRWI(wordCacheMaxCount, fileSizeMax);
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_CITATION, true)) try {
this.index.connectCitation(wordCacheMaxCount, fileSizeMax);
- } catch (IOException e) {Log.logException(e);}
+ } catch (IOException e) {ConcurrentLog.logException(e);}
if (this.getConfigBool(SwitchboardConstants.CORE_SERVICE_FULLTEXT, true)) {
this.index.connectUrlDb(this.useTailCache, this.exceed134217727);
- try {this.index.fulltext().connectLocalSolr();} catch (IOException e) {Log.logException(e);}
+ try {this.index.fulltext().connectLocalSolr();} catch (IOException e) {ConcurrentLog.logException(e);}
}
this.index.writeWebgraph(this.getConfigBool(SwitchboardConstants.CORE_SERVICE_WEBGRAPH, false));
@@ -499,7 +499,7 @@ public final class Switchboard extends serverSwitch {
ArrayList<RemoteInstance> instances = RemoteInstance.getShardInstances(solrurls, null, null, 10000);
this.index.fulltext().connectRemoteSolr(instances);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -534,16 +534,16 @@ public final class Switchboard extends serverSwitch {
this.domainList.loadList(new BufferedReader(r), null);
}
} catch ( final FileNotFoundException e ) {
- this.log.logSevere("CONFIG: domainlist not found: " + e.getMessage());
+ this.log.severe("CONFIG: domainlist not found: " + e.getMessage());
} catch ( final IOException e ) {
- this.log.logSevere("CONFIG: error while retrieving domainlist: " + e.getMessage());
+ this.log.severe("CONFIG: error while retrieving domainlist: " + e.getMessage());
}
// create a crawler
this.crawler = new CrawlSwitchboard(networkName, this.log, this.queuesRoot);
// start yacy core
- this.log.logConfig("Starting YaCy Protocol Core");
+ this.log.config("Starting YaCy Protocol Core");
this.yc = new Network(this);
InstantBusyThread.oneTimeJob(this, "loadSeedLists", 0);
//final long startedSeedListAquisition = System.currentTimeMillis();
@@ -582,7 +582,7 @@ public final class Switchboard extends serverSwitch {
blueList = new TreeSet<String>();
}
// blueListHashes = Word.words2hashesHandles(blueList);
- this.log.logConfig("loaded blue-list from file "
+ this.log.config("loaded blue-list from file "
+ plasmaBlueListFile.getName()
+ ", "
+ blueList.size()
@@ -591,7 +591,7 @@ public final class Switchboard extends serverSwitch {
}
// load blacklist
- this.log.logConfig("Loading blacklist ...");
+ this.log.config("Loading blacklist ...");
final File blacklistsPath =
getDataPath(SwitchboardConstants.LISTS_PATH, SwitchboardConstants.LISTS_PATH_DEFAULT);
urlBlacklist = new Blacklist(blacklistsPath);
@@ -604,7 +604,7 @@ public final class Switchboard extends serverSwitch {
final File badwordsFile = new File(appPath, SwitchboardConstants.LIST_BADWORDS_DEFAULT);
badwords = SetTools.loadList(badwordsFile, NaturalOrder.naturalComparator);
// badwordHashes = Word.words2hashesHandles(badwords);
- this.log.logConfig("loaded badwords from file "
+ this.log.config("loaded badwords from file "
+ badwordsFile.getName()
+ ", "
+ badwords.size()
@@ -630,7 +630,7 @@ public final class Switchboard extends serverSwitch {
}
}
- this.log.logConfig("loaded stopwords from file "
+ this.log.config("loaded stopwords from file "
+ stopwordsFile.getName()
+ ", "
+ stopwords.size()
@@ -639,12 +639,12 @@ public final class Switchboard extends serverSwitch {
}
// start a cache manager
- this.log.logConfig("Starting HT Cache Manager");
+ this.log.config("Starting HT Cache Manager");
// create the cache directory
this.htCachePath =
getDataPath(SwitchboardConstants.HTCACHE_PATH, SwitchboardConstants.HTCACHE_PATH_DEFAULT);
- this.log.logInfo("HTCACHE Path = " + this.htCachePath.getAbsolutePath());
+ this.log.info("HTCACHE Path = " + this.htCachePath.getAbsolutePath());
final long maxCacheSize =
1024L * 1024L * Long.parseLong(getConfig(SwitchboardConstants.PROXY_CACHE_SIZE, "2")); // this is megabyte
Cache.init(this.htCachePath, this.peers.mySeed().hash, maxCacheSize);
@@ -654,48 +654,48 @@ public final class Switchboard extends serverSwitch {
getDataPath(
SwitchboardConstants.SURROGATES_IN_PATH,
SwitchboardConstants.SURROGATES_IN_PATH_DEFAULT);
- this.log.logInfo("surrogates.in Path = " + this.surrogatesInPath.getAbsolutePath());
+ this.log.info("surrogates.in Path = " + this.surrogatesInPath.getAbsolutePath());
this.surrogatesInPath.mkdirs();
this.surrogatesOutPath =
getDataPath(
SwitchboardConstants.SURROGATES_OUT_PATH,
SwitchboardConstants.SURROGATES_OUT_PATH_DEFAULT);
- this.log.logInfo("surrogates.out Path = " + this.surrogatesOutPath.getAbsolutePath());
+ this.log.info("surrogates.out Path = " + this.surrogatesOutPath.getAbsolutePath());
this.surrogatesOutPath.mkdirs();
// create the release download directory
this.releasePath =
getDataPath(SwitchboardConstants.RELEASE_PATH, SwitchboardConstants.RELEASE_PATH_DEFAULT);
this.releasePath.mkdirs();
- this.log.logInfo("RELEASE Path = " + this.releasePath.getAbsolutePath());
+ this.log.info("RELEASE Path = " + this.releasePath.getAbsolutePath());
// starting message board
try {
initMessages();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// starting wiki
try {
initWiki();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
//starting blog
try {
initBlog();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// init User DB
- this.log.logConfig("Loading User DB");
+ this.log.config("Loading User DB");
final File userDbFile = new File(getDataPath(), "DATA/SETTINGS/user.heap");
try {
this.userDB = new UserDB(userDbFile);
- this.log.logConfig("Loaded User DB from file "
+ this.log.config("Loaded User DB from file "
+ userDbFile.getName()
+ ", "
+ this.userDB.size()
@@ -703,7 +703,7 @@ public final class Switchboard extends serverSwitch {
+ ", "
+ ppRamString(userDbFile.length() / 1024));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// init user triplestores
@@ -717,7 +717,7 @@ public final class Switchboard extends serverSwitch {
try {
Evaluation.add(new File(parserPropertiesPath, l));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -728,7 +728,7 @@ public final class Switchboard extends serverSwitch {
try {
Evaluation.add(new File(parserPropertiesPath, l));
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -742,16 +742,16 @@ public final class Switchboard extends serverSwitch {
try {
initBookmarks();
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}.start();
// define a realtime parsable mimetype list
- this.log.logConfig("Parser: Initializing Mime Type deny list");
+ this.log.config("Parser: Initializing Mime Type deny list");
final boolean enableAudioTags = getConfigBool("parser.enableAudioTags", false);
- log.logConfig("Parser: parser.enableAudioTags= "+enableAudioTags);
+ log.config("Parser: parser.enableAudioTags= "+enableAudioTags);
final StringBuilder denyExt = new StringBuilder(256);
final StringBuilder denyMime = new StringBuilder(256);
denyExt.append(getConfig(SwitchboardConstants.PARSER_MIME_DENY, ""));
@@ -777,16 +777,16 @@ public final class Switchboard extends serverSwitch {
TextParser.setDenyExtension(getConfig(SwitchboardConstants.PARSER_EXTENSIONS_DENY, ""));
// start a loader
- this.log.logConfig("Starting Crawl Loader");
+ this.log.config("Starting Crawl Loader");
this.loader = new LoaderDispatcher(this);
// load the robots.txt db
- this.log.logConfig("Initializing robots.txt DB");
+ this.log.config("Initializing robots.txt DB");
this.robots = new RobotsTxt(this.tables, this.loader);
try {
- this.log.logConfig("Loaded robots.txt DB: " + this.robots.size() + " entries");
+ this.log.config("Loaded robots.txt DB: " + this.robots.size() + " entries");
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// load oai tables
@@ -812,7 +812,7 @@ public final class Switchboard extends serverSwitch {
this.crawlJobsStatus.put(SwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER, new Object[] {new Object(), false});
// init cookie-Monitor
- this.log.logConfig("Starting Cookie Monitor");
+ this.log.config("Starting Cookie Monitor");
this.outgoingCookies = new ConcurrentHashMap<String, Object[]>();
this.incomingCookies = new ConcurrentHashMap<String, Object[]>();
@@ -838,14 +838,14 @@ public final class Switchboard extends serverSwitch {
try {
Domains.setNoCachingPatterns(getConfig(SwitchboardConstants.HTTPC_NAME_CACHE_CACHING_PATTERNS_NO, ""));
} catch (PatternSyntaxException pse) {
- Log.logSevere("Switchboard", "Invalid regular expression in "
+ ConcurrentLog.severe("Switchboard", "Invalid regular expression in "
+ SwitchboardConstants.HTTPC_NAME_CACHE_CACHING_PATTERNS_NO
+ " property: " + pse.getMessage());
System.exit(-1);
}
// generate snippets cache
- this.log.logConfig("Initializing Snippet Cache");
+ this.log.config("Initializing Snippet Cache");
// init the wiki
wikiParser = new WikiCode();
@@ -878,7 +878,7 @@ public final class Switchboard extends serverSwitch {
// We must remove that here to prevent that a user cannot log in any more
setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "");
// after this a message must be generated to alert the user to set a new password
- this.log.logInfo("RANDOM PASSWORD REMOVED! User must set a new password");
+ this.log.info("RANDOM PASSWORD REMOVED! User must set a new password");
}
}
@@ -940,7 +940,7 @@ public final class Switchboard extends serverSwitch {
WorkflowProcessor.availableCPU);
// deploy busy threads
- this.log.logConfig("Starting Threads");
+ this.log.config("Starting Threads");
MemoryControl.gc(10000, "plasmaSwitchboard, help for profiler"); // help for profiler - thq
deployThread(
@@ -1123,7 +1123,7 @@ public final class Switchboard extends serverSwitch {
}
}.start();
- this.log.logConfig("Finished Switchboard Initialization");
+ this.log.config("Finished Switchboard Initialization");
}
public int getIndexingProcessorsQueueSize() {
@@ -1201,7 +1201,7 @@ public final class Switchboard extends serverSwitch {
publicKey = cryptoLib.getPublicKeyFromBytes(publicKeyBytes);
}
} catch ( final InvalidKeySpecException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
final yacyUpdateLocation updateLocation = new yacyUpdateLocation(locationURL, publicKey);
yacyRelease.latestReleaseLocations.add(updateLocation);
@@ -1209,7 +1209,7 @@ public final class Switchboard extends serverSwitch {
}
} catch ( final NoSuchAlgorithmException e1 ) {
// TODO Auto-generated catch block
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
// set white/blacklists
@@ -1242,13 +1242,13 @@ public final class Switchboard extends serverSwitch {
if ( !getConfigBool(SwitchboardConstants.DHT_ENABLED, false)
&& getConfig("network.unit.tenant.agent", "").length() > 0 ) {
newagent = getConfig("network.unit.tenant.agent", "").trim();
- this.log.logInfo("new user agent: '" + newagent + "'");
+ this.log.info("new user agent: '" + newagent + "'");
}
ClientIdentification.setUserAgent(newagent);
}
public void switchNetwork(final String networkDefinition) throws FileNotFoundException, IOException {
- this.log.logInfo("SWITCH NETWORK: switching to '" + networkDefinition + "'");
+ this.log.info("SWITCH NETWORK: switching to '" + networkDefinition + "'");
// pause crawls
final boolean lcp = crawlJobIsPaused(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL);
if ( !lcp ) {
@@ -1260,7 +1260,7 @@ public final class Switchboard extends serverSwitch {
}
// trigger online caution
this.proxyLastAccess = System.currentTimeMillis() + 3000; // at least 3 seconds online caution to prevent unnecessary action on database meanwhile
- this.log.logInfo("SWITCH NETWORK: SHUT DOWN OF OLD INDEX DATABASE...");
+ this.log.info("SWITCH NETWORK: SHUT DOWN OF OLD INDEX DATABASE...");
// clean search events which have cached relations to the old index
SearchEventCache.cleanupEvents(true);
@@ -1283,7 +1283,7 @@ public final class Switchboard extends serverSwitch {
this.crawlStacker.close();
this.webStructure.close();
- this.log.logInfo("SWITCH NETWORK: START UP OF NEW INDEX DATABASE...");
+ this.log.info("SWITCH NETWORK: START UP OF NEW INDEX DATABASE...");
// new properties
setConfig("network.unit.definition", networkDefinition);
@@ -1335,7 +1335,7 @@ public final class Switchboard extends serverSwitch {
ArrayList<RemoteInstance> instances = RemoteInstance.getShardInstances(solrurls, null, null, 10000);
this.index.fulltext().connectRemoteSolr(instances);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -1365,9 +1365,9 @@ public final class Switchboard extends serverSwitch {
this.domainList.loadList(new BufferedReader(r), null);
}
} catch ( final FileNotFoundException e ) {
- this.log.logSevere("CONFIG: domainlist not found: " + e.getMessage());
+ this.log.severe("CONFIG: domainlist not found: " + e.getMessage());
} catch ( final IOException e ) {
- this.log.logSevere("CONFIG: error while retrieving domainlist: " + e.getMessage());
+ this.log.severe("CONFIG: error while retrieving domainlist: " + e.getMessage());
}
this.crawlStacker =
@@ -1388,7 +1388,7 @@ public final class Switchboard extends serverSwitch {
continueCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL);
continueCrawlJob(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
this.log
- .logInfo("SWITCH NETWORK: FINISHED START UP, new network is now '" + networkDefinition + "'.");
+ .info("SWITCH NETWORK: FINISHED START UP, new network is now '" + networkDefinition + "'.");
// set the network-specific remote crawl ppm
setRemotecrawlPPM(Math.max(1, (int) getConfigLong("network.unit.remotecrawl.speed", 60)));
@@ -1418,10 +1418,10 @@ public final class Switchboard extends serverSwitch {
}
public void initMessages() throws IOException {
- this.log.logConfig("Starting Message Board");
+ this.log.config("Starting Message Board");
final File messageDbFile = new File(this.workPath, "message.heap");
this.messageDB = new MessageBoard(messageDbFile);
- this.log.logConfig("Loaded Message Board DB from file "
+ this.log.config("Loaded Message Board DB from file "
+ messageDbFile.getName()
+ ", "
+ this.messageDB.size()
@@ -1431,10 +1431,10 @@ public final class Switchboard extends serverSwitch {
}
public void initWiki() throws IOException {
- this.log.logConfig("Starting Wiki Board");
+ this.log.config("Starting Wiki Board");
final File wikiDbFile = new File(this.workPath, "wiki.heap");
this.wikiDB = new WikiBoard(wikiDbFile, new File(this.workPath, "wiki-bkp.heap"));
- this.log.logConfig("Loaded Wiki Board DB from file "
+ this.log.config("Loaded Wiki Board DB from file "
+ wikiDbFile.getName()
+ ", "
+ this.wikiDB.size()
@@ -1444,10 +1444,10 @@ public final class Switchboard extends serverSwitch {
}
public void initBlog() throws IOException {
- this.log.logConfig("Starting Blog");
+ this.log.config("Starting Blog");
final File blogDbFile = new File(this.workPath, "blog.heap");
this.blogDB = new BlogBoard(blogDbFile);
- this.log.logConfig("Loaded Blog DB from file "
+ this.log.config("Loaded Blog DB from file "
+ blogDbFile.getName()
+ ", "
+ this.blogDB.size()
@@ -1457,7 +1457,7 @@ public final class Switchboard extends serverSwitch {
final File blogCommentDbFile = new File(this.workPath, "blogComment.heap");
this.blogCommentDB = new BlogBoardComments(blogCommentDbFile);
- this.log.logConfig("Loaded Blog-Comment DB from file "
+ this.log.config("Loaded Blog-Comment DB from file "
+ blogCommentDbFile.getName()
+ ", "
+ this.blogCommentDB.size()
@@ -1467,17 +1467,17 @@ public final class Switchboard extends serverSwitch {
}
public void initBookmarks() throws IOException {
- this.log.logConfig("Loading Bookmarks DB");
+ this.log.config("Loading Bookmarks DB");
final File bookmarksFile = new File(this.workPath, "bookmarks.heap");
final File tagsFile = new File(this.workPath, "bookmarkTags.heap");
final File datesFile = new File(this.workPath, "bookmarkDates.heap");
tagsFile.delete();
this.bookmarksDB = new BookmarksDB(bookmarksFile, datesFile);
- this.log.logConfig("Loaded Bookmarks DB from files "
+ this.log.config("Loaded Bookmarks DB from files "
+ bookmarksFile.getName()
+ ", "
+ tagsFile.getName());
- this.log.logConfig(this.bookmarksDB.tagsSize()
+ this.log.config(this.bookmarksDB.tagsSize()
+ " Tag, "
+ this.bookmarksDB.bookmarksSize()
+ " Bookmarks");
@@ -1698,11 +1698,11 @@ public final class Switchboard extends serverSwitch {
}
public synchronized void close() {
- this.log.logConfig("SWITCHBOARD SHUTDOWN STEP 1: sending termination signal to managed threads:");
+ this.log.config("SWITCHBOARD SHUTDOWN STEP 1: sending termination signal to managed threads:");
MemoryTracker.stopSystemProfiling();
terminateAllThreads(true);
net.yacy.gui.framework.Switchboard.shutdown();
- this.log.logConfig("SWITCHBOARD SHUTDOWN STEP 2: sending termination signal to threaded indexing");
+ this.log.config("SWITCHBOARD SHUTDOWN STEP 2: sending termination signal to threaded indexing");
// closing all still running db importer jobs
this.crawlStacker.announceClose();
this.crawlStacker.close();
@@ -1725,7 +1725,7 @@ public final class Switchboard extends serverSwitch {
this.webStructure.close();
this.crawlQueues.close();
this.crawler.close();
- this.log.logConfig("SWITCHBOARD SHUTDOWN STEP 3: sending termination signal to database manager (stand by...)");
+ this.log.config("SWITCHBOARD SHUTDOWN STEP 3: sending termination signal to database manager (stand by...)");
this.index.close();
this.peers.close();
Cache.close();
@@ -1738,9 +1738,9 @@ public final class Switchboard extends serverSwitch {
try {
HTTPClient.closeConnectionManager();
} catch ( final InterruptedException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- this.log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED");
+ this.log.config("SWITCHBOARD SHUTDOWN TERMINATED");
}
/**
@@ -1755,13 +1755,13 @@ public final class Switchboard extends serverSwitch {
// get next queue entry and start a queue processing
if ( response == null ) {
if ( this.log.isFine() ) {
- this.log.logFine("deQueue: queue entry is null");
+ this.log.fine("deQueue: queue entry is null");
}
return "queue entry is null";
}
if ( response.profile() == null ) {
if ( this.log.isFine() ) {
- this.log.logFine("deQueue: profile is null");
+ this.log.fine("deQueue: profile is null");
}
return "profile is null";
}
@@ -1844,7 +1844,7 @@ public final class Switchboard extends serverSwitch {
if (shallTerminate()) break;
}
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
moved = infile.renameTo(outfile);
if (zis != null) try {zis.close();} catch (IOException e) {}
@@ -1858,7 +1858,7 @@ public final class Switchboard extends serverSwitch {
}
processSurrogate(is, infile.getName());
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
if (!shallTerminate()) {
moved = infile.renameTo(outfile);
@@ -1876,9 +1876,9 @@ public final class Switchboard extends serverSwitch {
FileUtils.deletedelete(outfile);
}
} catch ( final FileNotFoundException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -1900,7 +1900,7 @@ public final class Switchboard extends serverSwitch {
final String urlRejectReason =
this.crawlStacker.urlInAcceptedDomain(surrogate.getIdentifier(true));
if ( urlRejectReason != null ) {
- this.log.logWarning("Rejected URL '"
+ this.log.warn("Rejected URL '"
+ surrogate.getIdentifier(true)
+ "': "
+ urlRejectReason);
@@ -1957,7 +1957,7 @@ public final class Switchboard extends serverSwitch {
final String cautionCause = onlineCaution();
if ( cautionCause != null ) {
if ( this.log.isFine() ) {
- this.log.logFine("deQueue: online caution for "
+ this.log.fine("deQueue: online caution for "
+ cautionCause
+ ", omitting resource stack processing");
}
@@ -2049,7 +2049,7 @@ public final class Switchboard extends serverSwitch {
long cs = this.index.fulltext().collectionSize();
if (cs > getConfigInt(SwitchboardConstants.GREEDYLEARNING_LIMIT_DOCCOUNT, 0)) {
setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false);
- log.logInfo("finishing greedy learning phase, size=" +cs);
+ log.info("finishing greedy learning phase, size=" +cs);
}
}
@@ -2097,7 +2097,7 @@ public final class Switchboard extends serverSwitch {
}
}
} catch ( final Exception e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
execAPIActions();
@@ -2109,7 +2109,7 @@ public final class Switchboard extends serverSwitch {
checkInterruption();
if ( (this.crawlQueues.delegatedURL.stackSize() > 1000) ) {
if ( this.log.isFine() ) {
- this.log.logFine("Cleaning Delegated-URLs report stack, "
+ this.log.fine("Cleaning Delegated-URLs report stack, "
+ this.crawlQueues.delegatedURL.stackSize()
+ " entries on stack");
}
@@ -2120,7 +2120,7 @@ public final class Switchboard extends serverSwitch {
checkInterruption();
if ( (this.crawlQueues.errorURL.stackSize() > 1000) ) {
if ( this.log.isFine() ) {
- this.log.logFine("Cleaning Error-URLs report stack, "
+ this.log.fine("Cleaning Error-URLs report stack, "
+ this.crawlQueues.errorURL.stackSize()
+ " entries on stack");
}
@@ -2132,7 +2132,7 @@ public final class Switchboard extends serverSwitch {
checkInterruption();
if ( ResultURLs.getStackSize(origin) > 1000 ) {
if ( this.log.isFine() ) {
- this.log.logFine("Cleaning Loaded-URLs report stack, "
+ this.log.fine("Cleaning Loaded-URLs report stack, "
+ ResultURLs.getStackSize(origin)
+ " entries on stack "
+ origin.getCode());
@@ -2145,19 +2145,19 @@ public final class Switchboard extends serverSwitch {
checkInterruption();
//cleanProfiles();
int cleanup = this.crawlJobIsPaused(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) ? 0 : this.crawler.cleanFinishesProfiles(this.crawlQueues);
- if (cleanup > 0) log.logInfo("cleanup removed " + cleanup + " crawl profiles");
+ if (cleanup > 0) log.info("cleanup removed " + cleanup + " crawl profiles");
// clean up news
checkInterruption();
try {
if ( this.log.isFine() ) {
- this.log.logFine("Cleaning Incoming News, "
+ this.log.fine("Cleaning Incoming News, "
+ this.peers.newsPool.size(NewsPool.INCOMING_DB)
+ " entries on stack");
}
this.peers.newsPool.automaticProcess(this.peers);
} catch ( final Exception e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if ( getConfigBool("cleanup.deletionProcessedNews", true) ) {
this.peers.newsPool.clear(NewsPool.PROCESSED_DB);
@@ -2212,19 +2212,19 @@ public final class Switchboard extends serverSwitch {
final yacyRelease updateVersion = yacyRelease.rulebasedUpdateInfo(false);
if ( updateVersion != null ) {
// there is a version that is more recent. Load it and re-start with it
- this.log.logInfo("AUTO-UPDATE: downloading more recent release " + updateVersion.getUrl());
+ this.log.info("AUTO-UPDATE: downloading more recent release " + updateVersion.getUrl());
final File downloaded = updateVersion.downloadRelease();
final boolean devenvironment = new File(this.getAppPath(), ".git").exists();
if ( devenvironment ) {
this.log
- .logInfo("AUTO-UPDATE: omitting update because this is a development environment");
+ .info("AUTO-UPDATE: omitting update because this is a development environment");
} else if ( (downloaded == null) || (!downloaded.exists()) || (downloaded.length() == 0) ) {
this.log
- .logInfo("AUTO-UPDATE: omitting update because download failed (file cannot be found, is too small or signature is bad)");
+ .info("AUTO-UPDATE: omitting update because download failed (file cannot be found, is too small or signature is bad)");
} else {
yacyRelease.deployRelease(downloaded);
terminate(10, "auto-update to install " + downloaded.getName());
- this.log.logInfo("AUTO-UPDATE: deploy and restart initiated");
+ this.log.info("AUTO-UPDATE: deploy and restart initiated");
}
}
@@ -2288,7 +2288,7 @@ public final class Switchboard extends serverSwitch {
return true;
} catch ( final InterruptedException e ) {
- this.log.logInfo("cleanupJob: Shutdown detected");
+ this.log.info("cleanupJob: Shutdown detected");
return false;
}
}
@@ -2339,7 +2339,7 @@ public final class Switchboard extends serverSwitch {
}
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
for (final String pk : pks) {
try {
@@ -2347,7 +2347,7 @@ public final class Switchboard extends serverSwitch {
WorkTables.calculateAPIScheduler(row, true); // calculate next update time
this.tables.update(WorkTables.TABLE_API_NAME, row);
} catch ( final Throwable e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue;
}
}
@@ -2356,7 +2356,7 @@ public final class Switchboard extends serverSwitch {
// execute api calls
final Map<String, Integer> callResult = this.tables.execAPICalls("localhost", (int) getConfigLong("port", 8090), getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, ""), pks);
for ( final Map.Entry<String, Integer> call : callResult.entrySet() ) {
- this.log.logInfo("Scheduler executed api call, response " + call.getValue() + ": " + call.getKey());
+ this.log.info("Scheduler executed api call, response " + call.getValue() + ": " + call.getKey());
}
}
@@ -2372,7 +2372,7 @@ public final class Switchboard extends serverSwitch {
}
setConfig(jobType + "_isPaused", "true");
setConfig(jobType + "_isPaused_cause", cause);
- log.logWarning("Crawl job '" + jobType + "' is paused: " + cause);
+ log.warn("Crawl job '" + jobType + "' is paused: " + cause);
}
/**
@@ -2424,7 +2424,7 @@ public final class Switchboard extends serverSwitch {
final EventOrigin processCase = response.processCase(this.peers.mySeed().hash);
if ( this.log.isFine() ) {
- this.log.logFine(
+ this.log.fine(
"processResourceStack processCase=" + processCase
+ ", depth=" + response.depth()
+ ", maxDepth=" + ((response.profile() == null) ? "null" : Integer.toString(response.profile().depth()))
@@ -2440,7 +2440,7 @@ public final class Switchboard extends serverSwitch {
// fetch the document from cache
response.setContent(Cache.getContent(response.url().hash()));
if ( response.getContent() == null ) {
- this.log.logWarning("the resource '" + response.url() + "' is missing in the cache.");
+ this.log.warn("the resource '" + response.url() + "' is missing in the cache.");
addURLtoErrorDB(
response.url(),
response.referrerHash(),
@@ -2464,7 +2464,7 @@ public final class Switchboard extends serverSwitch {
throw new Parser.Failure("Parser returned null.", response.url());
}
} catch ( final Parser.Failure e ) {
- this.log.logWarning("Unable to parse the resource '" + response.url() + "'. " + e.getMessage());
+ this.log.warn("Unable to parse the resource '" + response.url() + "'. " + e.getMessage());
addURLtoErrorDB(
response.url(),
response.referrerHash(),
@@ -2515,7 +2515,7 @@ public final class Switchboard extends serverSwitch {
// rewrite the url
String u0 = LibraryProvider.urlRewriter.apply(u);
if (!u.equals(u0)) {
- log.logInfo("REWRITE of url = \"" + u + "\" to \"" + u0 + "\"");
+ log.info("REWRITE of url = \"" + u + "\" to \"" + u0 + "\"");
u = u0;
}
@@ -2533,12 +2533,12 @@ public final class Switchboard extends serverSwitch {
0,
response.size() < 0 ? 0 : response.size()));
} catch ( final MalformedURLException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
final long stackEndTime = System.currentTimeMillis();
if ( this.log.isInfo() ) {
- this.log.logInfo("CRAWL: ADDED "
+ this.log.info("CRAWL: ADDED "
+ hl.size()
+ " LINKS FROM "
+ response.url().toNormalform(true)
@@ -2558,12 +2558,12 @@ public final class Switchboard extends serverSwitch {
// check profile attributes which prevent indexing (while crawling is allowed)
if (!profile.indexText() && !profile.indexMedia()) {
- if (this.log.isInfo()) this.log.logInfo("Not Condensed Resource '" + urls + "': indexing of this media type not wanted by crawl profile");
+ if (this.log.isInfo()) this.log.info("Not Condensed Resource '" + urls + "': indexing of this media type not wanted by crawl profile");
return new IndexingQueueEntry(in.queueEntry, in.documents, null);
}
if (!(profile.indexUrlMustMatchPattern() == CrawlProfile.MATCH_ALL_PATTERN || profile.indexUrlMustMatchPattern().matcher(urls).matches()) ||
(profile.indexUrlMustNotMatchPattern() != CrawlProfile.MATCH_NEVER_PATTERN && profile.indexUrlMustNotMatchPattern().matcher(urls).matches())) {
- if (this.log.isInfo()) this.log.logInfo("Not Condensed Resource '" + urls + "': indexing prevented by regular expression on url; indexUrlMustMatchPattern = " + profile.indexUrlMustMatchPattern().pattern() + ", indexUrlMustNotMatchPattern = " + profile.indexUrlMustNotMatchPattern().pattern());
+ if (this.log.isInfo()) this.log.info("Not Condensed Resource '" + urls + "': indexing prevented by regular expression on url; indexUrlMustMatchPattern = " + profile.indexUrlMustMatchPattern().pattern() + ", indexUrlMustNotMatchPattern = " + profile.indexUrlMustNotMatchPattern().pattern());
addURLtoErrorDB(
in.queueEntry.url(),
in.queueEntry.referrerHash(),
@@ -2578,7 +2578,7 @@ public final class Switchboard extends serverSwitch {
final List<Document> doclist = new ArrayList<Document>();
docloop: for (final Document document : in.documents) {
if (document.indexingDenied() && profile.obeyHtmlRobotsNoindex()) {
- if (this.log.isInfo()) this.log.logInfo("Not Condensed Resource '" + urls + "': denied by document-attached noindexing rule");
+ if (this.log.isInfo()) this.log.info("Not Condensed Resource '" + urls + "': denied by document-attached noindexing rule");
addURLtoErrorDB(
in.queueEntry.url(),
in.queueEntry.referrerHash(),
@@ -2590,7 +2590,7 @@ public final class Switchboard extends serverSwitch {
}
if (!(profile.indexContentMustMatchPattern() == CrawlProfile.MATCH_ALL_PATTERN || profile.indexContentMustMatchPattern().matcher(document.getTextString()).matches()) ||
(profile.indexContentMustNotMatchPattern() != CrawlProfile.MATCH_NEVER_PATTERN && profile.indexContentMustNotMatchPattern().matcher(document.getTextString()).matches())) {
- if (this.log.isInfo()) this.log.logInfo("Not Condensed Resource '" + urls + "': indexing prevented by regular expression on content; indexContentMustMatchPattern = " + profile.indexContentMustMatchPattern().pattern() + ", indexContentMustNotMatchPattern = " + profile.indexContentMustNotMatchPattern().pattern());
+ if (this.log.isInfo()) this.log.info("Not Condensed Resource '" + urls + "': indexing prevented by regular expression on content; indexContentMustMatchPattern = " + profile.indexContentMustMatchPattern().pattern() + ", indexContentMustNotMatchPattern = " + profile.indexContentMustNotMatchPattern().pattern());
addURLtoErrorDB(
in.queueEntry.url(),
in.queueEntry.referrerHash(),
@@ -2700,7 +2700,7 @@ public final class Switchboard extends serverSwitch {
}
// remove stopwords
- this.log.logInfo("Excluded " + condenser.excludeWords(stopwords) + " words in URL " + url);
+ this.log.info("Excluded " + condenser.excludeWords(stopwords) + " words in URL " + url);
// STORE WORD INDEX
SolrInputDocument newEntry =
@@ -2734,7 +2734,7 @@ public final class Switchboard extends serverSwitch {
try {
this.tables.update("rss", rssEntry.getKey().hash(), rssRow);
} catch ( final IOException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -2852,7 +2852,7 @@ public final class Switchboard extends serverSwitch {
int t = 100;
while (t-- > 0 && this.index.exists(ASCII.String(urlhash))) {
try {Thread.sleep(100);} catch (InterruptedException e) {}
- Log.logFine("Switchboard", "STACKURL: waiting for deletion, t=" + t);
+ ConcurrentLog.fine("Switchboard", "STACKURL: waiting for deletion, t=" + t);
if (t == 20) this.index.fulltext().commit(true);
if (t == 50) this.index.fulltext().commit(false);
}
@@ -2865,7 +2865,7 @@ public final class Switchboard extends serverSwitch {
return null;
} catch (final Exception e) {
// mist
- Log.logException(e);
+ ConcurrentLog.logException(e);
return "problem crawling an ftp site: " + e.getMessage();
}
}
@@ -2929,9 +2929,9 @@ public final class Switchboard extends serverSwitch {
try {
this.tables.bookmarks.createBookmark(this.loader, url, YMarkTables.USER_ADMIN, true, "crawlStart", "/Crawl Start");
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (Failure e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// that was ok
@@ -2959,14 +2959,14 @@ public final class Switchboard extends serverSwitch {
for (Map.Entry<String, DigestURI> e: urlmap.entrySet()) {
final String urlName = e.getValue().toNormalform(true);
if (existing.contains(e.getKey())) {
- this.log.logInfo("addToIndex: double " + urlName);
+ this.log.info("addToIndex: double " + urlName);
continue;
}
final Request request = this.loader.request(e.getValue(), true, true);
final CrawlProfile profile = this.crawler.getActive(ASCII.getBytes(request.profileHandle()));
final String acceptedError = this.crawlStacker.checkAcceptance(e.getValue(), profile, 0);
if (acceptedError != null) {
- this.log.logWarning("addToIndex: cannot load " + urlName + ": " + acceptedError);
+ this.log.warn("addToIndex: cannot load " + urlName + ": " + acceptedError);
continue;
}
requests.add(request);
@@ -3007,13 +3007,13 @@ public final class Switchboard extends serverSwitch {
condenser,
searchEvent,
"heuristic:" + heuristicName);
- Switchboard.this.log.logInfo("addToIndex fill of url " + urlName + " finished");
+ Switchboard.this.log.info("addToIndex fill of url " + urlName + " finished");
}
}
} catch ( final IOException e ) {
- Switchboard.this.log.logWarning("addToIndex: failed loading " + urlName + ": " + e.getMessage());
+ Switchboard.this.log.warn("addToIndex: failed loading " + urlName + ": " + e.getMessage());
} catch ( final Parser.Failure e ) {
- Switchboard.this.log.logWarning("addToIndex: failed parsing " + urlName + ": " + e.getMessage());
+ Switchboard.this.log.warn("addToIndex: failed parsing " + urlName + ": " + e.getMessage());
}
}
}
@@ -3039,7 +3039,7 @@ public final class Switchboard extends serverSwitch {
final CrawlProfile profile = this.crawler.getActive(ASCII.getBytes(request.profileHandle()));
final String acceptedError = this.crawlStacker.checkAcceptance(url, profile, 0);
if (acceptedError != null) {
- this.log.logInfo("addToCrawler: cannot load " + url.toNormalform(true) + ": " + acceptedError);
+ this.log.info("addToCrawler: cannot load " + url.toNormalform(true) + ": " + acceptedError);
return;
}
final String s;
@@ -3050,7 +3050,7 @@ public final class Switchboard extends serverSwitch {
}
if (s != null) {
- Switchboard.this.log.logInfo("addToCrawler: failed to add " + url.toNormalform(true) + ": " + s);
+ Switchboard.this.log.info("addToCrawler: failed to add " + url.toNormalform(true) + ": " + s);
}
}
}
@@ -3078,7 +3078,7 @@ public final class Switchboard extends serverSwitch {
this.reference,
"");
if ( response == null ) {
- Switchboard.this.log.logInfo("Sending crawl receipt for '"
+ Switchboard.this.log.info("Sending crawl receipt for '"
+ this.reference.url().toNormalform(true)
+ "' to "
+ this.initiatorPeer.getName()
@@ -3087,7 +3087,7 @@ public final class Switchboard extends serverSwitch {
return;
}
final String delay = response.get("delay");
- Switchboard.this.log.logInfo("Sending crawl receipt for '"
+ Switchboard.this.log.info("Sending crawl receipt for '"
+ this.reference.url().toNormalform(true)
+ "' to "
+ this.initiatorPeer.getName()
@@ -3253,7 +3253,7 @@ public final class Switchboard extends serverSwitch {
final String rejectReason = dhtShallTransfer();
if ( rejectReason != null ) {
if ( this.log.isFine() ) {
- this.log.logFine(rejectReason);
+ this.log.fine(rejectReason);
}
return false;
}
@@ -3261,19 +3261,19 @@ public final class Switchboard extends serverSwitch {
final long kbytesUp = ConnectionInfo.getActiveUpbytes() / 1024;
// accumulate RWIs to transmission cloud
if ( this.dhtDispatcher.cloudSize() > this.peers.scheme.verticalPartitions() ) {
- this.log.logInfo("dhtTransferJob: no selection, too many entries in transmission cloud: "
+ this.log.info("dhtTransferJob: no selection, too many entries in transmission cloud: "
+ this.dhtDispatcher.cloudSize());
} else if ( MemoryControl.available() < 1024 * 1024 * 25 ) {
- this.log.logInfo("dhtTransferJob: no selection, too less memory available : "
+ this.log.info("dhtTransferJob: no selection, too less memory available : "
+ (MemoryControl.available() / 1024 / 1024)
+ " MB");
} else if ( ConnectionInfo.getLoadPercent() > 50 ) {
- this.log.logInfo("dhtTransferJob: too many connections in httpc pool : "
+ this.log.info("dhtTransferJob: too many connections in httpc pool : "
+ ConnectionInfo.getCount());
// close unused connections
// Client.cleanup();
} else if ( kbytesUp > 128 ) {
- this.log.logInfo("dhtTransferJob: too much upload(1), currently uploading: " + kbytesUp + " Kb");
+ this.log.info("dhtTransferJob: too much upload(1), currently uploading: " + kbytesUp + " Kb");
} else {
byte[] startHash = null, limitHash = null;
int tries = 10;
@@ -3286,11 +3286,11 @@ public final class Switchboard extends serverSwitch {
}
}
if ( limitHash == null || startHash == null ) {
- this.log.logInfo("dhtTransferJob: approaching full DHT dispersion.");
+ this.log.info("dhtTransferJob: approaching full DHT dispersion.");
return false;
}
- this.log.logInfo("dhtTransferJob: selected " + ASCII.String(startHash) + " as start hash");
- this.log.logInfo("dhtTransferJob: selected " + ASCII.String(limitHash) + " as limit hash");
+ this.log.info("dhtTransferJob: selected " + ASCII.String(startHash) + " as start hash");
+ this.log.info("dhtTransferJob: selected " + ASCII.String(limitHash) + " as limit hash");
final boolean enqueued =
this.dhtDispatcher.selectContainersEnqueueToCloud(
startHash,
@@ -3299,25 +3299,25 @@ public final class Switchboard extends serverSwitch {
this.dhtMaxReferenceCount,
5000);
hasDoneSomething = hasDoneSomething | enqueued;
- this.log.logInfo("dhtTransferJob: result from enqueueing: " + ((enqueued) ? "true" : "false"));
+ this.log.info("dhtTransferJob: result from enqueueing: " + ((enqueued) ? "true" : "false"));
}
// check if we can deliver entries to other peers
if ( this.dhtDispatcher.transmissionSize() >= 10 ) {
this.log
- .logInfo("dhtTransferJob: no dequeueing from cloud to transmission: too many concurrent sessions: "
+ .info("dhtTransferJob: no dequeueing from cloud to transmission: too many concurrent sessions: "
+ this.dhtDispatcher.transmissionSize());
} else if ( ConnectionInfo.getLoadPercent() > 75 ) {
- this.log.logInfo("dhtTransferJob: too many connections in httpc pool : "
+ this.log.info("dhtTransferJob: too many connections in httpc pool : "
+ ConnectionInfo.getCount());
// close unused connections
// Client.cleanup();
} else if ( kbytesUp > 256 ) {
- this.log.logInfo("dhtTransferJob: too much upload(2), currently uploading: " + kbytesUp + " Kb");
+ this.log.info("dhtTransferJob: too much upload(2), currently uploading: " + kbytesUp + " Kb");
} else {
final boolean dequeued = this.dhtDispatcher.dequeueContainer();
hasDoneSomething = hasDoneSomething | dequeued;
- this.log.logInfo("dhtTransferJob: result from dequeueing: " + ((dequeued) ? "true" : "false"));
+ this.log.info("dhtTransferJob: result from dequeueing: " + ((dequeued) ? "true" : "false"));
}
return hasDoneSomething;
}
@@ -3361,7 +3361,7 @@ public final class Switchboard extends serverSwitch {
try {
url = new DigestURI(r);
} catch ( final MalformedURLException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return;
}
@@ -3381,7 +3381,7 @@ public final class Switchboard extends serverSwitch {
addAllToIndex(url, links, searchEvent, "site", new String[]{"site"});
}
} catch ( final Throwable e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
searchEvent.oneFeederTerminated();
}
@@ -3400,7 +3400,7 @@ public final class Switchboard extends serverSwitch {
try {
startUrl = new DigestURI(url);
} catch (final MalformedURLException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return;
}
@@ -3425,7 +3425,7 @@ public final class Switchboard extends serverSwitch {
}
}
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}.start();
@@ -3463,7 +3463,7 @@ public final class Switchboard extends serverSwitch {
try {
url = new DigestURI(MultiProtocolURI.unescape(urlString));
} catch ( final MalformedURLException e1 ) {
- Log.logWarning("heuristicRSS", "url not well-formed: '" + urlString + "'");
+ ConcurrentLog.warn("heuristicRSS", "url not well-formed: '" + urlString + "'");
return;
}
@@ -3487,7 +3487,7 @@ public final class Switchboard extends serverSwitch {
}
}
- Log.logInfo("heuristicRSS", "Heuristic: adding "
+ ConcurrentLog.info("heuristicRSS", "Heuristic: adding "
+ links.size()
+ " links from '"
+ feedName
@@ -3571,7 +3571,7 @@ public final class Switchboard extends serverSwitch {
String seedListFileURL;
final int sc = this.peers.sizeConnected();
- Network.log.logInfo("BOOTSTRAP: " + sc + " seeds known from previous run, concurrently starting seedlist loader");
+ Network.log.info("BOOTSTRAP: " + sc + " seeds known from previous run, concurrently starting seedlist loader");
// - use the superseed to further fill up the seedDB
AtomicInteger scc = new AtomicInteger(0);
@@ -3618,11 +3618,11 @@ public final class Switchboard extends serverSwitch {
yacyCore.log.logWarning("BOOTSTRAP: seed-list URL " + seedListFileURL + " not available, no content");
}
} else*/if ( header.lastModified() == null ) {
- Network.log.logWarning("BOOTSTRAP: seed-list URL "
+ Network.log.warn("BOOTSTRAP: seed-list URL "
+ seedListFileURL
+ " not usable, last-modified is missing");
} else if ( (header.age() > 86400000) && (scc.get() > 0) ) {
- Network.log.logInfo("BOOTSTRAP: seed-list URL "
+ Network.log.info("BOOTSTRAP: seed-list URL "
+ seedListFileURL
+ " too old ("
+ (header.age() / 86400000)
@@ -3645,10 +3645,10 @@ public final class Switchboard extends serverSwitch {
}
}
} catch ( final IOException e ) {
- Network.log.logInfo("BOOTSTRAP: bad seed from " + seedListFileURL + ": " + e.getMessage());
+ Network.log.info("BOOTSTRAP: bad seed from " + seedListFileURL + ": " + e.getMessage());
}
}
- Network.log.logInfo("BOOTSTRAP: "
+ Network.log.info("BOOTSTRAP: "
+ lc
+ " seeds from seed-list URL "
+ seedListFileURL
@@ -3659,11 +3659,11 @@ public final class Switchboard extends serverSwitch {
} catch ( final IOException e ) {
// this is when wget fails, commonly because of timeout
- Network.log.logInfo("BOOTSTRAP: failed (1) to load seeds from seed-list URL "
+ Network.log.info("BOOTSTRAP: failed (1) to load seeds from seed-list URL "
+ seedListFileURL + ": " + e.getMessage());
} catch ( final Exception e ) {
// this is when wget fails; may be because of missing internet connection
- Network.log.logSevere("BOOTSTRAP: failed (2) to load seeds from seed-list URL "
+ Network.log.severe("BOOTSTRAP: failed (2) to load seeds from seed-list URL "
+ seedListFileURL + ": " + e.getMessage(), e);
}
}
@@ -3715,7 +3715,7 @@ public final class Switchboard extends serverSwitch {
if ( delay <= 0 ) {
throw new IllegalArgumentException("The shutdown delay must be greater than 0.");
}
- this.log.logInfo("caught delayed terminate request: " + reason);
+ this.log.info("caught delayed terminate request: " + reason);
(new Shutdown(this, delay, reason)).start();
}
@@ -3725,7 +3725,7 @@ public final class Switchboard extends serverSwitch {
public void terminate(final String reason) {
this.terminate = true;
- this.log.logInfo("caught terminate request: " + reason);
+ this.log.info("caught terminate request: " + reason);
this.shutdownSync.release();
}
diff --git a/source/net/yacy/search/index/DocumentIndex.java b/source/net/yacy/search/index/DocumentIndex.java
index 1c9a6e0c2..7fe4458b9 100644
--- a/source/net/yacy/search/index/DocumentIndex.java
+++ b/source/net/yacy/search/index/DocumentIndex.java
@@ -34,12 +34,12 @@ import java.util.concurrent.LinkedBlockingQueue;
import org.apache.solr.common.SolrInputDocument;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.Condenser;
import net.yacy.document.Document;
import net.yacy.document.LibraryProvider;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.workflow.WorkflowProcessor;
import net.yacy.search.schema.CollectionConfiguration;
import net.yacy.search.schema.WebgraphConfiguration;
@@ -66,7 +66,7 @@ public class DocumentIndex extends Segment {
public DocumentIndex(final File segmentPath, final File collectionConfigurationPath, final File webgraphConfigurationPath, final CallbackListener callback, final int cachesize)
throws IOException {
- super(new Log("DocumentIndex"), segmentPath,
+ super(new ConcurrentLog("DocumentIndex"), segmentPath,
collectionConfigurationPath == null ? null : new CollectionConfiguration(collectionConfigurationPath, true),
webgraphConfigurationPath == null ? null : new WebgraphConfiguration(webgraphConfigurationPath, true)
);
@@ -112,7 +112,7 @@ public class DocumentIndex extends Segment {
}
} catch ( final IOException e ) {
if ( e.getMessage().indexOf("cannot parse", 0) < 0 ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
DocumentIndex.this.callback.fail(f, e.getMessage());
}
@@ -208,7 +208,7 @@ public class DocumentIndex extends Segment {
}
}
} catch ( final MalformedURLException e1 ) {
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
}
diff --git a/source/net/yacy/search/index/Fulltext.java b/source/net/yacy/search/index/Fulltext.java
index f021d410f..b8e577373 100644
--- a/source/net/yacy/search/index/Fulltext.java
+++ b/source/net/yacy/search/index/Fulltext.java
@@ -60,6 +60,7 @@ import net.yacy.cora.sorting.ScoreMap;
import net.yacy.cora.sorting.WeakPriorityBlockingQueue;
import net.yacy.cora.storage.ZIPReader;
import net.yacy.cora.storage.ZIPWriter;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.parser.html.CharacterCoding;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
@@ -68,7 +69,6 @@ import net.yacy.kelondro.data.word.WordReferenceVars;
import net.yacy.kelondro.index.Cache;
import net.yacy.kelondro.index.Index;
import net.yacy.kelondro.index.Row;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.table.SplitTable;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.search.Switchboard;
@@ -164,10 +164,10 @@ public final class Fulltext {
Version luceneVersion = localCollectionConnector.getConfig().getLuceneVersion("luceneMatchVersion");
String lvn = luceneVersion.name();
- Log.logInfo("Fulltext", "using lucene version " + lvn);
+ ConcurrentLog.info("Fulltext", "using lucene version " + lvn);
int p = lvn.indexOf('_');
assert SOLR_PATH.endsWith(lvn.substring(p)) : "luceneVersion = " + lvn + ", solrPath = " + SOLR_PATH + ", p = " + p + ", check defaults/solr/solrconfig.xml";
- Log.logInfo("Fulltext", "connected solr in " + solrLocation.toString() + ", lucene version " + lvn + ", default core size: " + localCollectionConnector.getSize());
+ ConcurrentLog.info("Fulltext", "connected solr in " + solrLocation.toString() + ", lucene version " + lvn + ", default core size: " + localCollectionConnector.getSize());
this.solrInstances.connect0(localCollectionInstance);
}
@@ -351,7 +351,7 @@ public final class Fulltext {
return new URIMetadataNode(doc, wre, weight);
}
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// get the metadata from the old metadata index
@@ -365,7 +365,7 @@ public final class Fulltext {
SolrDocument sd = this.collectionConfiguration.toSolrDocument(solrInput);
return new URIMetadataNode(sd, wre, weight);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return null;
@@ -376,7 +376,7 @@ public final class Fulltext {
if (connector == null) return;
String id = (String) doc.getFieldValue(CollectionSchema.id.getSolrFieldName());
String url = (String) doc.getFieldValue(CollectionSchema.sku.getSolrFieldName());
- Log.logInfo("Fulltext", "indexing: " + id + " " + url);
+ ConcurrentLog.info("Fulltext", "indexing: " + id + " " + url);
byte[] idb = ASCII.getBytes(id);
try {
if (this.urlIndexFile != null) this.urlIndexFile.remove(idb);
@@ -548,7 +548,7 @@ public final class Fulltext {
this.getDefaultConnector().deleteByIds(deleteIDs);
this.getWebgraphConnector().deleteByIds(deleteIDs);
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (Fulltext.this.urlIndexFile != null) try {
for (String id: deleteIDs) {
@@ -565,7 +565,7 @@ public final class Fulltext {
this.getDefaultConnector().deleteById(id);
this.getWebgraphConnector().deleteById(id);
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (this.urlIndexFile != null) try {
final Row.Entry r = this.urlIndexFile.remove(urlHash);
@@ -584,7 +584,7 @@ public final class Fulltext {
try {
if (this.getDefaultConnector().existsById(urlHash)) return true;
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return false;
}
@@ -615,7 +615,7 @@ public final class Fulltext {
Set<String> e1 = this.getDefaultConnector().existsByIds(idsC);
e.addAll(e1);
} catch (final Throwable ee) {
- Log.logException(ee);
+ ConcurrentLog.logException(ee);
}
return e;
}
@@ -631,19 +631,19 @@ public final class Fulltext {
EmbeddedInstance esc = this.solrInstances.getSolr0();
ArrayList<File> zips = new ArrayList<File>();
if (esc == null) {
- Log.logWarning("Fulltext", "HOT DUMP selected solr0 == NULL, no dump list!");
+ ConcurrentLog.warn("Fulltext", "HOT DUMP selected solr0 == NULL, no dump list!");
return zips;
}
if (esc.getContainerPath() == null) {
- Log.logWarning("Fulltext", "HOT DUMP selected solr0.getStoragePath() == NULL, no dump list!");
+ ConcurrentLog.warn("Fulltext", "HOT DUMP selected solr0.getStoragePath() == NULL, no dump list!");
return zips;
}
File storagePath = esc.getContainerPath().getParentFile();
if (storagePath == null) {
- Log.logWarning("Fulltext", "HOT DUMP selected esc.getStoragePath().getParentFile() == NULL, no dump list!");
+ ConcurrentLog.warn("Fulltext", "HOT DUMP selected esc.getStoragePath().getParentFile() == NULL, no dump list!");
return zips;
}
- Log.logInfo("Fulltext", "HOT DUMP dump path = " + storagePath.toString());
+ ConcurrentLog.info("Fulltext", "HOT DUMP dump path = " + storagePath.toString());
for (String p: storagePath.list()) {
if (p.endsWith("zip")) zips.add(new File(storagePath, p));
}
@@ -664,13 +664,13 @@ public final class Fulltext {
try {
ZIPWriter.zip(storagePath, zipOut);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
this.solrInstances = new InstanceMirror();
try {
this.connectLocalSolr();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -690,13 +690,13 @@ public final class Fulltext {
try {
ZIPReader.unzip(solrDumpZipFile, storagePath);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
this.solrInstances = new InstanceMirror();
try {
this.connectLocalSolr();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -723,7 +723,7 @@ public final class Fulltext {
try {
this.connectLocalSolr();
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -731,7 +731,7 @@ public final class Fulltext {
// export methods
public Export export(final File f, final String filter, final int format, final boolean dom) {
if ((this.exportthread != null) && (this.exportthread.isAlive())) {
- Log.logWarning("LURL-EXPORT", "cannot start another export thread, already one running");
+ ConcurrentLog.warn("LURL-EXPORT", "cannot start another export thread, already one running");
return this.exportthread;
}
this.exportthread = new Export(f, filter, format, dom);
@@ -838,10 +838,10 @@ public final class Fulltext {
}
pw.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.failure = e.getMessage();
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
this.failure = e.getMessage();
}
// terminate process
diff --git a/source/net/yacy/search/index/ReindexSolrBusyThread.java b/source/net/yacy/search/index/ReindexSolrBusyThread.java
index eb1677536..ff5fddf13 100644
--- a/source/net/yacy/search/index/ReindexSolrBusyThread.java
+++ b/source/net/yacy/search/index/ReindexSolrBusyThread.java
@@ -20,11 +20,11 @@ package net.yacy.search.index;
*/
import java.io.IOException;
-import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import java.util.ArrayList;
import java.util.concurrent.Semaphore;
import net.yacy.cora.federate.solr.connector.EmbeddedSolrConnector;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.workflow.AbstractBusyThread;
import net.yacy.search.schema.CollectionConfiguration;
import org.apache.solr.common.SolrDocument;
@@ -124,7 +124,7 @@ import org.apache.solr.common.SolrInputDocument;
chunksize = chunksize + 10;
}
} else {
- Log.logInfo("MIGRATION-REINDEX", "reindex docs with query=" + query + " found=" + docstoreindex + " start=" + start);
+ ConcurrentLog.info("MIGRATION-REINDEX", "reindex docs with query=" + query + " found=" + docstoreindex + " start=" + start);
start = start + chunksize;
for (SolrDocument doc : xdocs) {
@@ -134,7 +134,7 @@ import org.apache.solr.common.SolrInputDocument;
}
}
} catch (IOException ex) {
- Log.logException(ex);
+ ConcurrentLog.logException(ex);
} finally {
sem.release();
}
diff --git a/source/net/yacy/search/index/Segment.java b/source/net/yacy/search/index/Segment.java
index 5c5edd8c8..806693397 100644
--- a/source/net/yacy/search/index/Segment.java
+++ b/source/net/yacy/search/index/Segment.java
@@ -52,6 +52,7 @@ import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.LookAheadIterator;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.data.CrawlQueues;
@@ -68,7 +69,6 @@ import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceFactory;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.IndexCell;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceFactory;
@@ -112,7 +112,7 @@ public class Segment {
public static final ReferenceFactory<CitationReference> citationReferenceFactory = new CitationReferenceFactory();
public static final ByteOrder wordOrder = Base64Order.enhancedCoder;
- private final Log log;
+ private final ConcurrentLog log;
private final File segmentPath;
protected final Fulltext fulltext;
protected IndexCell<WordReference> termIndex;
@@ -126,9 +126,9 @@ public class Segment {
* @param segmentPath that should be the path ponting to the directory "SEGMENT"
* @param collectionSchema
*/
- public Segment(final Log log, final File segmentPath,
+ public Segment(final ConcurrentLog log, final File segmentPath,
final CollectionConfiguration collectionConfiguration, final WebgraphConfiguration webgraphConfiguration) {
- log.logInfo("Initializing Segment '" + segmentPath + ".");
+ log.info("Initializing Segment '" + segmentPath + ".");
this.log = log;
this.segmentPath = segmentPath;
@@ -297,7 +297,7 @@ public class Segment {
cache.put(id, rr);
return rr;
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
throw new IOException(e.getMessage());
}
}
@@ -343,7 +343,7 @@ public class Segment {
}
}
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
} else {
// read the references from the citation index
@@ -410,7 +410,7 @@ public class Segment {
try {
return (int) this.fulltext.getDefaultConnector().getCountByQuery(CollectionSchema.text_t.getSolrFieldName() + ":\"" + word + "\"");
} catch (Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return 0;
}
}
@@ -457,7 +457,7 @@ public class Segment {
try {
doc = docQueue.take();
} catch (InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
if (doc == null || doc == AbstractSolrConnector.POISON_DOCUMENT) return null;
@@ -483,7 +483,7 @@ public class Segment {
if (this.fulltext != null) this.fulltext.clearRemoteSolr();
if (this.urlCitationIndex != null) this.urlCitationIndex.clear();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -566,7 +566,7 @@ public class Segment {
try {
this.fulltext().putDocument(queueEntry.queueEntry);
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -696,7 +696,7 @@ public class Segment {
break tryloop;
} catch ( final IOException e ) {
error = "failed to send " + urlNormalform + " to solr: " + e.getMessage();
- Log.logWarning("SOLR", error);
+ ConcurrentLog.warn("SOLR", error);
if (i == 10) this.fulltext.commit(false);
try {Thread.sleep(1000);} catch (InterruptedException e1) {}
continue tryloop;
@@ -704,7 +704,7 @@ public class Segment {
}
}
if (error != null) {
- Log.logSevere("SOLR", error + ", PLEASE REPORT TO bugs.yacy.net");
+ ConcurrentLog.severe("SOLR", error + ", PLEASE REPORT TO bugs.yacy.net");
//Switchboard.getSwitchboard().pauseCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL, error);
//Switchboard.getSwitchboard().pauseCrawlJob(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL, error);
}
@@ -743,7 +743,7 @@ public class Segment {
if (this.termIndex != null && storeToRWI) try {
this.termIndex.add(wordhash, ientry);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// during a search event it is possible that a heuristic is used which aquires index
@@ -769,7 +769,7 @@ public class Segment {
if (this.termIndex != null) try {
this.termIndex.add(catchallHash, ientry);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -777,7 +777,7 @@ public class Segment {
final long indexingEndTime = System.currentTimeMillis();
if (this.log.isInfo()) {
- this.log.logInfo("*Indexed " + condenser.words().size() + " words in URL " + url +
+ this.log.info("*Indexed " + condenser.words().size() + " words in URL " + url +
" [" + id + "]" +
"\n\tDescription: " + dc_title +
"\n\tMimeType: " + document.dc_format() + " | Charset: " + document.getCharset() + " | " +
@@ -832,7 +832,7 @@ public class Segment {
} catch (final Parser.Failure e) {
return 0;
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return 0;
}
}
diff --git a/source/net/yacy/search/query/AccessTracker.java b/source/net/yacy/search/query/AccessTracker.java
index 407f965b9..9d4f4ec91 100644
--- a/source/net/yacy/search/query/AccessTracker.java
+++ b/source/net/yacy/search/query/AccessTracker.java
@@ -37,7 +37,7 @@ import java.util.LinkedList;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.document.WordCache;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
public class AccessTracker {
@@ -158,9 +158,9 @@ public class AccessTracker {
}
logCopy.clear();
} catch (final FileNotFoundException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
if (raf != null) try {raf.close();} catch (IOException e) {}
}
diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.java
index 95bff101d..9d7aa81f4 100644
--- a/source/net/yacy/search/query/QueryParams.java
+++ b/source/net/yacy/search/query/QueryParams.java
@@ -49,6 +49,7 @@ import net.yacy.cora.geo.GeoLocation;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.document.Condenser;
import net.yacy.document.LibraryProvider;
@@ -56,7 +57,6 @@ import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.SetTools;
import net.yacy.peers.Seed;
@@ -307,7 +307,7 @@ public final class QueryParams {
for (int i = 0; i < (query.length() / Word.commonHashLength); i++) try {
keyhashes.put(ASCII.getBytes(query.substring(i * Word.commonHashLength, (i + 1) * Word.commonHashLength)));
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
return keyhashes;
@@ -529,7 +529,7 @@ public final class QueryParams {
params.setFields("*", "score"); // we need the score for post-ranking
// prepare result
- Log.logInfo("Protocol", "SOLR QUERY: " + params.toString());
+ ConcurrentLog.info("Protocol", "SOLR QUERY: " + params.toString());
this.cachedQuery = params;
return params;
}
diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java
index 4a990db7a..6db0fea4d 100644
--- a/source/net/yacy/search/query/SearchEvent.java
+++ b/source/net/yacy/search/query/SearchEvent.java
@@ -58,6 +58,7 @@ import net.yacy.cora.sorting.WeakPriorityBlockingQueue;
import net.yacy.cora.sorting.WeakPriorityBlockingQueue.Element;
import net.yacy.cora.sorting.WeakPriorityBlockingQueue.ReverseElement;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.WorkTables;
import net.yacy.document.Condenser;
@@ -71,7 +72,6 @@ import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceFactory;
import net.yacy.kelondro.data.word.WordReferenceVars;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.TermSearch;
import net.yacy.kelondro.util.Bitfield;
@@ -106,7 +106,7 @@ public final class SearchEvent {
}
*/
- public static Log log = new Log("SEARCH");
+ public static ConcurrentLog log = new ConcurrentLog("SEARCH");
public static final int SNIPPET_MAX_LENGTH = 220;
private static final int MAX_TOPWORDS = 12; // default count of words for topicnavigagtor
@@ -195,7 +195,7 @@ public final class SearchEvent {
SearchEventCache.cleanupEvents(false);
int en = SearchEventCache.size();
if (en < eb) {
- log.logInfo("Cleaned up search event cache (1) " + eb + "->" + en + ", " + (ab - MemoryControl.available()) / 1024 / 1024 + " MB freed");
+ log.info("Cleaned up search event cache (1) " + eb + "->" + en + ", " + (ab - MemoryControl.available()) / 1024 / 1024 + " MB freed");
}
}
ab = MemoryControl.available();
@@ -203,7 +203,7 @@ public final class SearchEvent {
SearchEventCache.cleanupEvents(Math.max(1, (int) (MemoryControl.available() / (1024 * 1024 * 120))));
int en = SearchEventCache.size();
if (en < eb) {
- log.logInfo("Cleaned up search event cache (2) " + eb + "->" + en + ", " + (ab - MemoryControl.available()) / 1024 / 1024 + " MB freed");
+ log.info("Cleaned up search event cache (2) " + eb + "->" + en + ", " + (ab - MemoryControl.available()) / 1024 / 1024 + " MB freed");
}
this.eventTime = System.currentTimeMillis(); // for lifetime check
@@ -317,17 +317,17 @@ public final class SearchEvent {
}.start();
}
if ( this.primarySearchThreadsL != null ) {
- Log.logFine("SEARCH_EVENT", "STARTING "
+ ConcurrentLog.fine("SEARCH_EVENT", "STARTING "
+ this.primarySearchThreadsL.size()
+ " THREADS TO CATCH EACH "
+ remote_maxcount
+ " URLs");
EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.EventSearch(this.query.id(true), SearchEventType.REMOTESEARCH_START, "", this.primarySearchThreadsL.size(), System.currentTimeMillis() - timer), false);
// finished searching
- Log.logFine("SEARCH_EVENT", "SEARCH TIME AFTER GLOBAL-TRIGGER TO " + this.primarySearchThreadsL.size() + " PEERS: " + ((System.currentTimeMillis() - start) / 1000) + " seconds");
+ ConcurrentLog.fine("SEARCH_EVENT", "SEARCH TIME AFTER GLOBAL-TRIGGER TO " + this.primarySearchThreadsL.size() + " PEERS: " + ((System.currentTimeMillis() - start) / 1000) + " seconds");
} else {
// no search since query is empty, user might have entered no data or filters have removed all search words
- Log.logFine("SEARCH_EVENT", "NO SEARCH STARTED DUE TO EMPTY SEARCH REQUEST.");
+ ConcurrentLog.fine("SEARCH_EVENT", "NO SEARCH STARTED DUE TO EMPTY SEARCH REQUEST.");
}
} else {
this.primarySearchThreadsL = null;
@@ -456,7 +456,7 @@ public final class SearchEvent {
SearchEvent.this.addFinalize();
}
} catch ( final Exception e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
oneFeederTerminated();
}
@@ -508,12 +508,12 @@ public final class SearchEvent {
pollloop: while ( true ) {
remaining = timeout - System.currentTimeMillis();
if (remaining <= 0) {
- Log.logWarning("SearchEvent", "terminated 'add' loop before poll time-out = " + remaining + ", decodedEntries.size = " + decodedEntries.size());
+ ConcurrentLog.warn("SearchEvent", "terminated 'add' loop before poll time-out = " + remaining + ", decodedEntries.size = " + decodedEntries.size());
break;
}
iEntry = decodedEntries.poll(remaining, TimeUnit.MILLISECONDS);
if (iEntry == null) {
- Log.logWarning("SearchEvent", "terminated 'add' loop after poll time-out = " + remaining + ", decodedEntries.size = " + decodedEntries.size());
+ ConcurrentLog.warn("SearchEvent", "terminated 'add' loop after poll time-out = " + remaining + ", decodedEntries.size = " + decodedEntries.size());
break pollloop;
}
if (iEntry == WordReferenceVars.poison) {
@@ -523,7 +523,7 @@ public final class SearchEvent {
// doublecheck for urls
if (this.urlhashes.has(iEntry.urlhash())) {
- if (log.isFine()) log.logFine("dropped RWI: doublecheck");
+ if (log.isFine()) log.fine("dropped RWI: doublecheck");
continue pollloop;
}
@@ -535,7 +535,7 @@ public final class SearchEvent {
// check constraints
if (!this.testFlags(flags)) {
- if (log.isFine()) log.logFine("dropped RWI: flag test failed");
+ if (log.isFine()) log.fine("dropped RWI: flag test failed");
continue pollloop;
}
@@ -545,7 +545,7 @@ public final class SearchEvent {
(this.query.contentdom == ContentDomain.VIDEO && !(flags.get(Condenser.flag_cat_hasvideo))) ||
(this.query.contentdom == ContentDomain.IMAGE && !(flags.get(Condenser.flag_cat_hasimage))) ||
(this.query.contentdom == ContentDomain.APP && !(flags.get(Condenser.flag_cat_hasapp))))) {
- if (log.isFine()) log.logFine("dropped RWI: contentdom fail");
+ if (log.isFine()) log.fine("dropped RWI: contentdom fail");
continue pollloop;
}
@@ -556,13 +556,13 @@ public final class SearchEvent {
final String hosthash = iEntry.hosthash();
if ( this.query.modifier.sitehash == null ) {
if (this.query.siteexcludes != null && this.query.siteexcludes.contains(hosthash)) {
- if (log.isFine()) log.logFine("dropped RWI: siteexcludes");
+ if (log.isFine()) log.fine("dropped RWI: siteexcludes");
continue pollloop;
}
} else {
// filter out all domains that do not match with the site constraint
if (!hosthash.equals(this.query.modifier.sitehash)) {
- if (log.isFine()) log.logFine("dropped RWI: modifier.sitehash");
+ if (log.isFine()) log.fine("dropped RWI: modifier.sitehash");
continue pollloop;
}
}
@@ -575,14 +575,14 @@ public final class SearchEvent {
break rankingtryloop;
} catch ( final ArithmeticException e ) {
// this may happen if the concurrent normalizer changes values during cardinal computation
- if (log.isFine()) log.logFine("dropped RWI: arithmetic exception");
+ if (log.isFine()) log.fine("dropped RWI: arithmetic exception");
continue rankingtryloop;
}
}
// increase counter for statistics
if (local) this.local_rwi_available.incrementAndGet(); else this.remote_rwi_available.incrementAndGet();
}
- if (System.currentTimeMillis() >= timeout) Log.logWarning("SearchEvent", "rwi normalization ended with timeout = " + maxtime);
+ if (System.currentTimeMillis() >= timeout) ConcurrentLog.warn("SearchEvent", "rwi normalization ended with timeout = " + maxtime);
} catch ( final InterruptedException e ) {
} catch ( final SpaceExceededException e ) {
@@ -799,14 +799,14 @@ public final class SearchEvent {
if ( !this.query.urlMask_isCatchall ) {
// check url mask
if (!iEntry.matches(this.query.urlMask)) {
- if (log.isFine()) log.logFine("dropped Node: url mask does not match");
+ if (log.isFine()) log.fine("dropped Node: url mask does not match");
continue pollloop;
}
}
// doublecheck for urls
if (this.urlhashes.has(iEntry.hash())) {
- if (log.isFine()) log.logFine("dropped Node: double check");
+ if (log.isFine()) log.fine("dropped Node: double check");
continue pollloop;
}
@@ -818,7 +818,7 @@ public final class SearchEvent {
// check constraints
Bitfield flags = iEntry.flags();
if (!this.testFlags(flags)) {
- if (log.isFine()) log.logFine("dropped Node: flag test");
+ if (log.isFine()) log.fine("dropped Node: flag test");
continue pollloop;
}
@@ -828,7 +828,7 @@ public final class SearchEvent {
(this.query.contentdom == ContentDomain.VIDEO && !(flags.get(Condenser.flag_cat_hasvideo))) ||
(this.query.contentdom == ContentDomain.IMAGE && !(flags.get(Condenser.flag_cat_hasimage))) ||
(this.query.contentdom == ContentDomain.APP && !(flags.get(Condenser.flag_cat_hasapp))))) {
- if (log.isFine()) log.logFine("dropped Node: content domain does not match");
+ if (log.isFine()) log.fine("dropped Node: content domain does not match");
continue pollloop;
}
@@ -836,13 +836,13 @@ public final class SearchEvent {
final String hosthash = iEntry.hosthash();
if ( this.query.modifier.sitehash == null ) {
if (this.query.siteexcludes != null && this.query.siteexcludes.contains(hosthash)) {
- if (log.isFine()) log.logFine("dropped Node: siteexclude");
+ if (log.isFine()) log.fine("dropped Node: siteexclude");
continue pollloop;
}
} else {
// filter out all domains that do not match with the site constraint
if (iEntry.url().getHost().indexOf(this.query.modifier.sitehost) < 0) {
- if (log.isFine()) log.logFine("dropped Node: sitehost");
+ if (log.isFine()) log.fine("dropped Node: sitehost");
continue pollloop;
}
}
@@ -935,7 +935,7 @@ public final class SearchEvent {
try {
m = i.next();
} catch (final ConcurrentModificationException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
continue mainloop; // not the best solution...
}
if (m == null) continue doubleloop;
@@ -972,7 +972,7 @@ public final class SearchEvent {
URIMetadataNode node = this.query.getSegment().fulltext().getMetadata(bestEntry);
if (node == null) {
if (bestEntry.getElement().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
- if (log.isFine()) log.logFine("dropped RWI: hash not in metadata");
+ if (log.isFine()) log.fine("dropped RWI: hash not in metadata");
continue mainloop;
}
return node;
@@ -995,14 +995,14 @@ public final class SearchEvent {
while ((page = pullOneRWI(skipDoubleDom)) != null) {
if (!this.query.urlMask_isCatchall && !page.matches(this.query.urlMask)) {
- if (log.isFine()) log.logFine("dropped RWI: no match with urlMask");
+ if (log.isFine()) log.fine("dropped RWI: no match with urlMask");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
// check for more errors
if (page.url() == null) {
- if (log.isFine()) log.logFine("dropped RWI: url == null");
+ if (log.isFine()) log.fine("dropped RWI: url == null");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue; // rare case where the url is corrupted
}
@@ -1013,14 +1013,14 @@ public final class SearchEvent {
(this.query.contentdom == Classification.ContentDomain.AUDIO && page.url().getContentDomain() != Classification.ContentDomain.AUDIO) ||
(this.query.contentdom == Classification.ContentDomain.VIDEO && page.url().getContentDomain() != Classification.ContentDomain.VIDEO) ||
(this.query.contentdom == Classification.ContentDomain.APP && page.url().getContentDomain() != Classification.ContentDomain.APP)) && this.query.urlMask_isCatchall) {
- if (log.isFine()) log.logFine("dropped RWI: wrong contentdom = " + this.query.contentdom + ", domain = " + page.url().getContentDomain());
+ if (log.isFine()) log.fine("dropped RWI: wrong contentdom = " + this.query.contentdom + ", domain = " + page.url().getContentDomain());
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
// Check for blacklist
if (Switchboard.urlBlacklist.isListed(BlacklistType.SEARCH, page)) {
- if (log.isFine()) log.logFine("dropped RWI: url is blacklisted in url blacklist");
+ if (log.isFine()) log.fine("dropped RWI: url is blacklisted in url blacklist");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
@@ -1029,7 +1029,7 @@ public final class SearchEvent {
if (Switchboard.getSwitchboard().getConfigBool("contentcontrol.enabled", false)) {
FilterEngine f = ContentControlFilterUpdateThread.getNetworkFilter();
if (f != null && !f.isListed(page.url(), null)) {
- if (log.isFine()) log.logFine("dropped RWI: url is blacklisted in contentcontrol");
+ if (log.isFine()) log.fine("dropped RWI: url is blacklisted in contentcontrol");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
@@ -1044,7 +1044,7 @@ public final class SearchEvent {
((QueryParams.anymatch(pagetitle, this.query.getQueryGoal().getExcludeHashes()))
|| (QueryParams.anymatch(pageurl.toLowerCase(), this.query.getQueryGoal().getExcludeHashes()))
|| (QueryParams.anymatch(pageauthor.toLowerCase(), this.query.getQueryGoal().getExcludeHashes())))) {
- if (log.isFine()) log.logFine("dropped RWI: no match with query goal exclusion");
+ if (log.isFine()) log.fine("dropped RWI: no match with query goal exclusion");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
@@ -1057,14 +1057,14 @@ public final class SearchEvent {
this.query.getSegment().termIndex().removeDelayed(wi.next(), page.hash());
}
}
- if (log.isFine()) log.logFine("dropped RWI: url does not match index-of constraint");
+ if (log.isFine()) log.fine("dropped RWI: url does not match index-of constraint");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
// check location constraint
if ((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_haslocation)) && (page.lat() == 0.0 || page.lon() == 0.0)) {
- if (log.isFine()) log.logFine("dropped RWI: location constraint");
+ if (log.isFine()) log.fine("dropped RWI: location constraint");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
@@ -1076,7 +1076,7 @@ public final class SearchEvent {
double lonDelta = this.query.lon - lon;
double distance = Math.sqrt(latDelta * latDelta + lonDelta * lonDelta); // pythagoras
if (distance > this.query.radius) {
- if (log.isFine()) log.logFine("dropped RWI: radius constraint");
+ if (log.isFine()) log.fine("dropped RWI: radius constraint");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
@@ -1084,7 +1084,7 @@ public final class SearchEvent {
// check Scanner
if (this.query.filterscannerfail && !Scanner.acceptURL(page.url())) {
- if (log.isFine()) log.logFine("dropped RWI: url not accepted by scanner");
+ if (log.isFine()) log.fine("dropped RWI: url not accepted by scanner");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
@@ -1276,7 +1276,7 @@ public final class SearchEvent {
180,
!this.query.isLocal());
final long snippetComputationTime = System.currentTimeMillis() - startTime;
- SearchEvent.log.logInfo("text snippet load time for " + page.url() + ": " + snippetComputationTime + ", " + (!snippet.getErrorCode().fail() ? "snippet found" : ("no snippet found (" + snippet.getError() + ")")));
+ SearchEvent.log.info("text snippet load time for " + page.url() + ": " + snippetComputationTime + ", " + (!snippet.getErrorCode().fail() ? "snippet found" : ("no snippet found (" + snippet.getError() + ")")));
if (!snippet.getErrorCode().fail()) {
// we loaded the file and found the snippet
@@ -1295,7 +1295,7 @@ public final class SearchEvent {
if (this.deleteIfSnippetFail) {
this.workTables.failURLsRegisterMissingWord(this.query.getSegment().termIndex(), page.url(), this.query.getQueryGoal().getIncludeHashes(), reason);
}
- SearchEvent.log.logInfo("sorted out url " + page.url().toNormalform(true) + " during search: " + reason);
+ SearchEvent.log.info("sorted out url " + page.url().toNormalform(true) + " during search: " + reason);
return null;
}
}
@@ -1326,7 +1326,7 @@ public final class SearchEvent {
while ( this.resultList.sizeAvailable() <= item &&
(this.rwiQueueSize() > 0 || this.nodeStack.sizeQueue() > 0 ||
(!this.feedingIsFinished() && System.currentTimeMillis() < finishTime))) {
- if (!drainStacksToResult()) try {Thread.sleep(10);} catch (final InterruptedException e) {Log.logException(e);}
+ if (!drainStacksToResult()) try {Thread.sleep(10);} catch (final InterruptedException e) {ConcurrentLog.logException(e);}
}
// check if we have a success
diff --git a/source/net/yacy/search/query/SearchEventCache.java b/source/net/yacy/search/query/SearchEventCache.java
index cd5cac7ff..83d61cb3a 100644
--- a/source/net/yacy/search/query/SearchEventCache.java
+++ b/source/net/yacy/search/query/SearchEventCache.java
@@ -31,8 +31,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.SortedMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.peers.SeedDB;
import net.yacy.repository.LoaderDispatcher;
@@ -167,7 +167,7 @@ public class SearchEventCache {
if (event == null) {
// check if there are too many other searches alive now
synchronized (lastEvents) {
- Log.logInfo("SearchEventCache", "getEvent: " + lastEvents.size() + " in cache");
+ ConcurrentLog.info("SearchEventCache", "getEvent: " + lastEvents.size() + " in cache");
}
// start a new event
diff --git a/source/net/yacy/search/query/SecondarySearchSuperviser.java b/source/net/yacy/search/query/SecondarySearchSuperviser.java
index af613faf2..a0f465b51 100644
--- a/source/net/yacy/search/query/SecondarySearchSuperviser.java
+++ b/source/net/yacy/search/query/SecondarySearchSuperviser.java
@@ -11,7 +11,7 @@ import java.util.TreeSet;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.SetTools;
import net.yacy.peers.RemoteSearch;
@@ -183,7 +183,7 @@ public class SecondarySearchSuperviser extends Thread {
if ( words.isEmpty() ) {
continue; // ???
}
- Log.logInfo("SearchEvent.SecondarySearchSuperviser", "asking peer " + peer + " for urls: " + urls + " from words: " + words);
+ ConcurrentLog.info("SearchEvent.SecondarySearchSuperviser", "asking peer " + peer + " for urls: " + urls + " from words: " + words);
this.checkedPeers.add(peer);
this.searchEvent.secondarySearchThreads[c++] =
RemoteSearch.secondaryRemoteSearch(
diff --git a/source/net/yacy/search/ranking/BlockRank.java b/source/net/yacy/search/ranking/BlockRank.java
index ac548e8ac..3dd0f407e 100644
--- a/source/net/yacy/search/ranking/BlockRank.java
+++ b/source/net/yacy/search/ranking/BlockRank.java
@@ -36,9 +36,9 @@ import net.yacy.cora.document.ASCII;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.sorting.OrderedScoreMap;
import net.yacy.cora.sorting.ScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.kelondro.index.BinSearch;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceContainerCache;
import net.yacy.kelondro.rwi.ReferenceIterator;
@@ -75,17 +75,17 @@ public class BlockRank {
// get the local index
if (myGraph != null) try {
final ReferenceContainerCache<HostReference> myIndex = myGraph.incomingReferences();
- Log.logInfo("BlockRank", "loaded " + myIndex.size() + " host indexes from my peer");
+ ConcurrentLog.info("BlockRank", "loaded " + myIndex.size() + " host indexes from my peer");
index.merge(myIndex);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// wait for termination
for (final IndexRetrieval job: jobs) try { job.join(); } catch (final InterruptedException e) { }
- Log.logInfo("BlockRank", "create " + index.size() + " host indexes from all peers");
+ ConcurrentLog.info("BlockRank", "create " + index.size() + " host indexes from all peers");
return index;
}
@@ -104,13 +104,13 @@ public class BlockRank {
public void run() {
final ReferenceContainerCache<HostReference> partialIndex = Protocol.loadIDXHosts(this.seed);
if (partialIndex == null || partialIndex.isEmpty()) return;
- Log.logInfo("BlockRank", "loaded " + partialIndex.size() + " host indexes from peer " + this.seed.getName());
+ ConcurrentLog.info("BlockRank", "loaded " + partialIndex.size() + " host indexes from peer " + this.seed.getName());
try {
this.index.merge(partialIndex);
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -121,14 +121,14 @@ public class BlockRank {
* @param file
*/
public static void saveHostIndex(final ReferenceContainerCache<HostReference> index, final File file) {
- Log.logInfo("BlockRank", "saving " + index.size() + " host indexes to file " + file.toString());
+ ConcurrentLog.info("BlockRank", "saving " + index.size() + " host indexes to file " + file.toString());
index.dump(file, Segment.writeBufferSize, false);
- Log.logInfo("BlockRank", "saved " + index.size() + " host indexes to file " + file.toString());
+ ConcurrentLog.info("BlockRank", "saved " + index.size() + " host indexes to file " + file.toString());
}
public static ReferenceContainerCache<HostReference> loadHostIndex(final File file) {
- Log.logInfo("BlockRank", "reading host indexes from file " + file.toString());
+ ConcurrentLog.info("BlockRank", "reading host indexes from file " + file.toString());
final ReferenceContainerCache<HostReference> index = new ReferenceContainerCache<HostReference>(WebStructureGraph.hostReferenceFactory, Base64Order.enhancedCoder, 6);
// load from file
@@ -140,12 +140,12 @@ public class BlockRank {
}
ri.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- Log.logInfo("BlockRank", "read " + index.size() + " host indexes from file " + file.toString());
+ ConcurrentLog.info("BlockRank", "read " + index.size() + " host indexes from file " + file.toString());
return index;
}
@@ -186,14 +186,14 @@ public class BlockRank {
while (hostScore.size() > 10) {
final List<byte[]> smallest = hostScore.lowerHalf();
if (smallest.isEmpty()) break; // should never happen but this ensures termination of the loop
- Log.logInfo("BlockRank", "index evaluation: computed partition of size " + smallest.size());
+ ConcurrentLog.info("BlockRank", "index evaluation: computed partition of size " + smallest.size());
table.add(new BinSearch(smallest, 6));
for (final byte[] host: smallest) hostScore.delete(host);
}
if (!hostScore.isEmpty()) {
final ArrayList<byte[]> list = new ArrayList<byte[]>();
for (final byte[] entry: hostScore) list.add(entry);
- Log.logInfo("BlockRank", "index evaluation: computed last partition of size " + list.size());
+ ConcurrentLog.info("BlockRank", "index evaluation: computed last partition of size " + list.size());
table.add(new BinSearch(list, 6));
}
diff --git a/source/net/yacy/search/ranking/RankingProfile.java b/source/net/yacy/search/ranking/RankingProfile.java
index 7131f48b7..cf1747988 100644
--- a/source/net/yacy/search/ranking/RankingProfile.java
+++ b/source/net/yacy/search/ranking/RankingProfile.java
@@ -32,8 +32,8 @@ import java.util.Map;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.document.analysis.Classification.ContentDomain;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
-import net.yacy.kelondro.logging.Log;
public class RankingProfile {
@@ -147,7 +147,7 @@ public class RankingProfile {
coeff.put(e.substring(s, p), Integer.valueOf(NumberTools.parseIntDecSubstring(e, p + 1)));
} catch (final NumberFormatException e1) {
System.out.println("wrong parameter: " + e.substring(s, p) + "=" + e.substring(p + 1));
- Log.logException(e1);
+ ConcurrentLog.logException(e1);
}
}
}
diff --git a/source/net/yacy/search/ranking/ReferenceOrder.java b/source/net/yacy/search/ranking/ReferenceOrder.java
index 3b6291e22..65db58de5 100644
--- a/source/net/yacy/search/ranking/ReferenceOrder.java
+++ b/source/net/yacy/search/ranking/ReferenceOrder.java
@@ -34,6 +34,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.Semaphore;
import net.yacy.cora.sorting.ConcurrentScoreMap;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.Condenser;
import net.yacy.document.LargeNumberCache;
import net.yacy.kelondro.data.meta.DigestURI;
@@ -41,7 +42,6 @@ import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.data.word.WordReferenceVars;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.ByteBuffer;
@@ -115,7 +115,7 @@ public class ReferenceOrder {
worker[p % this.threads].add(iEntry);
p++;
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("NormalizeDistributor", "adding of decoded rows to workers ended with timeout = " + this.maxtime);
+ ConcurrentLog.warn("NormalizeDistributor", "adding of decoded rows to workers ended with timeout = " + this.maxtime);
}
}
} catch (final InterruptedException e) {
@@ -179,7 +179,7 @@ public class ReferenceOrder {
}
if (System.currentTimeMillis() > timeout) {
- Log.logWarning("NormalizeWorker", "normlization of decoded rows ended with timeout = " + this.maxtime);
+ ConcurrentLog.warn("NormalizeWorker", "normlization of decoded rows ended with timeout = " + this.maxtime);
break;
}
}
@@ -193,9 +193,9 @@ public class ReferenceOrder {
}
if (!ReferenceOrder.this.doms.isEmpty()) ReferenceOrder.this.maxdomcount = ReferenceOrder.this.doms.getMaxScore();
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
// insert poison to signal the termination to next queue
try {
diff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.java
index f4c6aba0b..c1b7fe218 100644
--- a/source/net/yacy/search/schema/CollectionConfiguration.java
+++ b/source/net/yacy/search/schema/CollectionConfiguration.java
@@ -62,6 +62,7 @@ import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.cora.storage.HandleSet;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.retrieval.Response;
import net.yacy.document.Condenser;
@@ -73,7 +74,6 @@ import net.yacy.kelondro.data.citation.CitationReference;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.RowHandleMap;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.IndexCell;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.search.index.Segment;
@@ -112,7 +112,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
CollectionSchema f = CollectionSchema.valueOf(etr.key());
f.setSolrFieldName(etr.getValue());
} catch (IllegalArgumentException e) {
- Log.logFine("SolrCollectionWriter", "solr schema file " + configurationFile.getAbsolutePath() + " defines unknown attribute '" + etr.toString() + "'");
+ ConcurrentLog.fine("SolrCollectionWriter", "solr schema file " + configurationFile.getAbsolutePath() + " defines unknown attribute '" + etr.toString() + "'");
it.remove();
}
}
@@ -122,7 +122,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
if (CollectionSchema.author_sxt.getSolrFieldName().endsWith(field.name())) continue; // exception for this: that is a copy-field
if (CollectionSchema.coordinate_p_0_coordinate.getSolrFieldName().endsWith(field.name())) continue; // exception for this: automatically generated
if (CollectionSchema.coordinate_p_1_coordinate.getSolrFieldName().endsWith(field.name())) continue; // exception for this: automatically generated
- Log.logWarning("SolrCollectionWriter", " solr schema file " + configurationFile.getAbsolutePath() + " is missing declaration for '" + field.name() + "'");
+ ConcurrentLog.warn("SolrCollectionWriter", " solr schema file " + configurationFile.getAbsolutePath() + " is missing declaration for '" + field.name() + "'");
}
}
}
@@ -897,7 +897,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
while (convergence_attempts++ < 30) {
if (crh.convergenceStep()) break;
}
- Log.logInfo("CollectionConfiguration.CRHost", "convergence for host " + host + " after " + convergence_attempts + " steps");
+ ConcurrentLog.info("CollectionConfiguration.CRHost", "convergence for host " + host + " after " + convergence_attempts + " steps");
// we have now the cr for all documents of a specific host; we store them for later use
Map<byte[], CRV> crn = crh.normalize();
crh.log(crn);
@@ -961,7 +961,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
} catch (Throwable e1) {
}
}
- Log.logInfo("CollectionConfiguration", "cleanup_processing: re-calculated " + proccount+ " new documents, " +
+ ConcurrentLog.info("CollectionConfiguration", "cleanup_processing: re-calculated " + proccount+ " new documents, " +
proccount_clickdepthchange + " clickdepth changes, " +
proccount_referencechange + " reference-count changes," +
proccount_citationchange + " citation ranking changes.");
@@ -1058,10 +1058,10 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
if (entry == null || entry.getValue() == null) continue;
try {
String url = (String) connector.getDocumentById(ASCII.String(entry.getKey()), CollectionSchema.sku.getSolrFieldName()).getFieldValue(CollectionSchema.sku.getSolrFieldName());
- Log.logInfo("CollectionConfiguration.CRHost", "CR for " + url);
- Log.logInfo("CollectionConfiguration.CRHost", ">> " + entry.getValue().toString());
+ ConcurrentLog.info("CollectionConfiguration.CRHost", "CR for " + url);
+ ConcurrentLog.info("CollectionConfiguration.CRHost", ">> " + entry.getValue().toString());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -1087,9 +1087,9 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
this.internal_links_counter.put(id, il);
return il;
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
try {this.internal_links_counter.put(id, 0);} catch (SpaceExceededException e) {}
return 0;
diff --git a/source/net/yacy/search/schema/WebgraphConfiguration.java b/source/net/yacy/search/schema/WebgraphConfiguration.java
index 7773fb9a5..e760bedcc 100644
--- a/source/net/yacy/search/schema/WebgraphConfiguration.java
+++ b/source/net/yacy/search/schema/WebgraphConfiguration.java
@@ -51,10 +51,10 @@ import net.yacy.cora.federate.solr.connector.SolrConnector;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.parser.html.ImageEntry;
import net.yacy.kelondro.data.citation.CitationReference;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.IndexCell;
import net.yacy.search.index.Segment;
@@ -89,14 +89,14 @@ public class WebgraphConfiguration extends SchemaConfiguration implements Serial
WebgraphSchema f = WebgraphSchema.valueOf(etr.key());
f.setSolrFieldName(etr.getValue());
} catch (IllegalArgumentException e) {
- Log.logFine("SolrWebgraphWriter", "solr schema file " + configurationFile.getAbsolutePath() + " defines unknown attribute '" + etr.toString() + "'");
+ ConcurrentLog.fine("SolrWebgraphWriter", "solr schema file " + configurationFile.getAbsolutePath() + " defines unknown attribute '" + etr.toString() + "'");
it.remove();
}
}
// check consistency the other way: look if all enum constants in SolrField appear in the configuration file
for (SchemaDeclaration field: WebgraphSchema.values()) {
if (this.get(field.name()) == null) {
- Log.logWarning("SolrWebgraphWriter", " solr schema file " + configurationFile.getAbsolutePath() + " is missing declaration for '" + field.name() + "'");
+ ConcurrentLog.warn("SolrWebgraphWriter", " solr schema file " + configurationFile.getAbsolutePath() + " is missing declaration for '" + field.name() + "'");
}
}
}
@@ -328,7 +328,7 @@ public class WebgraphConfiguration extends SchemaConfiguration implements Serial
}
}
- Log.logInfo("WebgraphConfiguration", "cleanup_processing: re-calculated " + proccount+ " new documents, " + proccount_clickdepthchange + " clickdepth values changed, " + proccount_referencechange + " reference-count values changed.");
+ ConcurrentLog.info("WebgraphConfiguration", "cleanup_processing: re-calculated " + proccount+ " new documents, " + proccount_clickdepthchange + " clickdepth values changed, " + proccount_referencechange + " reference-count values changed.");
} catch (InterruptedException e) {
}
}
diff --git a/source/net/yacy/search/snippet/MediaSnippet.java b/source/net/yacy/search/snippet/MediaSnippet.java
index 88376b058..cd6513630 100644
--- a/source/net/yacy/search/snippet/MediaSnippet.java
+++ b/source/net/yacy/search/snippet/MediaSnippet.java
@@ -42,6 +42,7 @@ import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.storage.HandleSet;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.data.ZURL.FailCategory;
@@ -52,7 +53,6 @@ import net.yacy.document.WordTokenizer;
import net.yacy.document.parser.html.ImageEntry;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.index.RowHandleSet;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteArray;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
@@ -137,7 +137,7 @@ public class MediaSnippet implements Comparable<MediaSnippet>, Comparator<MediaS
public static List<MediaSnippet> retrieveMediaSnippets(final DigestURI url, final HandleSet queryhashes, final Classification.ContentDomain mediatype, final CacheStrategy cacheStrategy, final boolean reindexing) {
if (queryhashes.isEmpty()) {
- Log.logFine("snippet fetch", "no query hashes given for url " + url);
+ ConcurrentLog.fine("snippet fetch", "no query hashes given for url " + url);
return new ArrayList<MediaSnippet>();
}
@@ -145,10 +145,10 @@ public class MediaSnippet implements Comparable<MediaSnippet>, Comparator<MediaS
try {
document = Document.mergeDocuments(url, null, Switchboard.getSwitchboard().loader.loadDocuments(Switchboard.getSwitchboard().loader.request(url, false, reindexing), cacheStrategy, Integer.MAX_VALUE, BlacklistType.SEARCH, TextSnippet.snippetMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT));
} catch (final IOException e) {
- Log.logFine("snippet fetch", "load error: " + e.getMessage());
+ ConcurrentLog.fine("snippet fetch", "load error: " + e.getMessage());
return new ArrayList<MediaSnippet>();
} catch (final Parser.Failure e) {
- Log.logFine("snippet fetch", "parser error: " + e.getMessage());
+ ConcurrentLog.fine("snippet fetch", "parser error: " + e.getMessage());
return new ArrayList<MediaSnippet>();
}
final ArrayList<MediaSnippet> a = new ArrayList<MediaSnippet>();
@@ -239,7 +239,7 @@ public class MediaSnippet implements Comparable<MediaSnippet>, Comparator<MediaS
try {
remaininghashes.put(hash);
} catch (final SpaceExceededException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -260,7 +260,7 @@ public class MediaSnippet implements Comparable<MediaSnippet>, Comparator<MediaS
// check if url is in blacklist
if (Switchboard.urlBlacklist.isListed(blacklistType, url.getHost().toLowerCase(), url.getFile())) {
Switchboard.getSwitchboard().crawlQueues.errorURL.push(new Request(url, null), ASCII.getBytes(Switchboard.getSwitchboard().peers.mySeed().hash), new Date(), 1, FailCategory.FINAL_LOAD_CONTEXT, "url in blacklist", -1);
- Log.logFine("snippet fetch", "MEDIA-SNIPPET Rejecting URL '" + url.toString() + "'. URL is in blacklist.");
+ ConcurrentLog.fine("snippet fetch", "MEDIA-SNIPPET Rejecting URL '" + url.toString() + "'. URL is in blacklist.");
isBlacklisted = true;
}
diff --git a/source/net/yacy/search/snippet/ResultEntry.java b/source/net/yacy/search/snippet/ResultEntry.java
index ac516cb9c..672861b94 100644
--- a/source/net/yacy/search/snippet/ResultEntry.java
+++ b/source/net/yacy/search/snippet/ResultEntry.java
@@ -33,6 +33,7 @@ import java.util.List;
import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.order.Base64Order;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.Condenser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
@@ -40,7 +41,6 @@ import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.data.word.WordReferenceVars;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.ByteArray;
@@ -96,7 +96,7 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
urlentry.dc_title()), null).keySet()),
urlentry.hash());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
indexSegment.fulltext().remove(urlentry.hash()); // clean up
throw new RuntimeException("index void");
diff --git a/source/net/yacy/server/http/HTTPDFileHandler.java b/source/net/yacy/server/http/HTTPDFileHandler.java
index 0df0bbb99..216513104 100644
--- a/source/net/yacy/server/http/HTTPDFileHandler.java
+++ b/source/net/yacy/server/http/HTTPDFileHandler.java
@@ -102,13 +102,13 @@ import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
import net.yacy.data.UserDB;
import net.yacy.document.parser.htmlParser;
import net.yacy.document.parser.html.ContentScraper;
import net.yacy.document.parser.html.ScraperInputStream;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -151,7 +151,7 @@ public final class HTTPDFileHandler {
//private Properties connectionProperties = null;
// creating a logger
- private static final Log theLogger = new Log("FILEHANDLER");
+ private static final ConcurrentLog theLogger = new ConcurrentLog("FILEHANDLER");
static {
final serverSwitch theSwitchboard = Switchboard.getSwitchboard();
@@ -165,7 +165,7 @@ public final class HTTPDFileHandler {
if (Classification.countMimes() == 0) {
// load the mime table
final String mimeTablePath = theSwitchboard.getConfig("mimeTable","");
- Log.logConfig("HTTPDFiles", "Loading mime mapping file " + mimeTablePath);
+ ConcurrentLog.config("HTTPDFiles", "Loading mime mapping file " + mimeTablePath);
Classification.init(new File(theSwitchboard.getAppPath(), mimeTablePath));
}
@@ -347,7 +347,7 @@ public final class HTTPDFileHandler {
// in case that we are still not granted we ask for a password
if (!accessGranted) {
- Log.logInfo("HTTPD", "Wrong log-in for path '" + path + "' from host '" + clientIP + "'");
+ ConcurrentLog.info("HTTPD", "Wrong log-in for path '" + path + "' from host '" + clientIP + "'");
final Integer attempts = serverCore.bfHost.get(clientIP);
if (attempts == null)
serverCore.bfHost.put(clientIP, Integer.valueOf(1));
@@ -680,7 +680,7 @@ public final class HTTPDFileHandler {
HeaderFramework.http1_1.get(
Integer.toString(403)),
null);
- Log.logWarning(
+ ConcurrentLog.warn(
"HTTPD",
"CGI script " + targetFile.getPath()
+ " could not be executed due to "
@@ -818,7 +818,7 @@ public final class HTTPDFileHandler {
Integer.parseInt(
value.substring(0, 3));
} catch (final NumberFormatException ex) {
- Log.logWarning(
+ ConcurrentLog.warn(
"HTTPD",
"CGI script " + targetFile.getPath()
+ " returned illegal status code \""
@@ -869,14 +869,14 @@ public final class HTTPDFileHandler {
HeaderFramework.http1_1.get(
Integer.toString(statusCode)),
null);
- Log.logWarning(
+ ConcurrentLog.warn(
"HTTPD",
"CGI script " + targetFile.getPath()
+ " returned exit value " + exitValue
+ ", body empty: "
+ (cgiBody == null || cgiBody.isEmpty()));
if (error.length() > 0) {
- Log.logWarning("HTTPD", "Reported error: " + error);
+ ConcurrentLog.warn("HTTPD", "Reported error: " + error);
}
}
}
@@ -963,7 +963,7 @@ public final class HTTPDFileHandler {
if (templatePatterns.containsKey(serverObjects.ACTION_AUTHENTICATE)) {
// handle brute-force protection
if (realmProp != null) {
- Log.logInfo("HTTPD", "dynamic log-in for account 'admin' in http file handler for path '" + path + "' from host '" + clientIP + "'");
+ ConcurrentLog.info("HTTPD", "dynamic log-in for account 'admin' in http file handler for path '" + path + "' from host '" + clientIP + "'");
final Integer attempts = serverCore.bfHost.get(clientIP);
if (attempts == null)
serverCore.bfHost.put(clientIP, Integer.valueOf(1));
@@ -1033,9 +1033,9 @@ public final class HTTPDFileHandler {
ref = new SoftReference<TemplateCacheEntry>(templateCacheEntry);
if (MemoryControl.shortStatus()) templateCache.clear();
templateCache.put(targetFile, ref);
- if (theLogger.isFinest()) theLogger.logFinest("Cache MISS for file " + targetFile);
+ if (theLogger.isFinest()) theLogger.finest("Cache MISS for file " + targetFile);
} else {
- if (theLogger.isFinest()) theLogger.logFinest("Cache HIT for file " + targetFile);
+ if (theLogger.isFinest()) theLogger.finest("Cache HIT for file " + targetFile);
}
// creating an inputstream needed by the template
@@ -1154,7 +1154,7 @@ public final class HTTPDFileHandler {
header.put(HeaderFramework.ETAG, targetMD5);
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
if (requestHeader.containsKey(HeaderFramework.RANGE)) {
@@ -1215,7 +1215,7 @@ public final class HTTPDFileHandler {
}
}
} else {
- if (!targetFile.exists()) Log.logWarning("HTTPDFileHandler", "target file " + targetFile.getAbsolutePath() + " does not exist");
+ if (!targetFile.exists()) ConcurrentLog.warn("HTTPDFileHandler", "target file " + targetFile.getAbsolutePath() + " does not exist");
//if (!targetFile.isFile()) Log.logWarning("HTTPDFileHandler", "target file " + targetFile.getAbsolutePath() + " is not a file");
//if (!targetFile.canRead()) Log.logWarning("HTTPDFileHandler", "target file " + targetFile.getAbsolutePath() + " cannot read");
HTTPDemon.sendRespondError(conProp,out,3,404,"File not Found",null,null);
@@ -1225,7 +1225,7 @@ public final class HTTPDFileHandler {
try {
// error handling
if (e instanceof NullPointerException) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
int httpStatusCode = 400;
final String httpStatusText = null;
@@ -1273,7 +1273,7 @@ public final class HTTPDFileHandler {
// if it is an unexpected error we log it
if (httpStatusCode == 500) {
- theLogger.logWarning(errorMessage.toString(), e);
+ theLogger.warn(errorMessage.toString(), e);
}
} catch (final Exception ee) {
@@ -1305,7 +1305,7 @@ public final class HTTPDFileHandler {
}
ret.add(targetFile.getAbsolutePath());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
try {br.close();} catch (IOException e) {}
}
@@ -1404,10 +1404,10 @@ public final class HTTPDFileHandler {
}
} catch (final ClassNotFoundException e) {
- Log.logSevere("HTTPDFileHandler", "class " + classFile + " is missing:" + e.getMessage());
+ ConcurrentLog.severe("HTTPDFileHandler", "class " + classFile + " is missing:" + e.getMessage());
throw new InvocationTargetException(e, "class " + classFile + " is missing:" + e.getMessage());
} catch (final NoSuchMethodException e) {
- Log.logSevere("HTTPDFileHandler", "method 'respond' not found in class " + classFile + ": " + e.getMessage());
+ ConcurrentLog.severe("HTTPDFileHandler", "method 'respond' not found in class " + classFile + ": " + e.getMessage());
throw new InvocationTargetException(e, "method 'respond' not found in class " + classFile + ": " + e.getMessage());
}
return m;
@@ -1420,13 +1420,13 @@ public final class HTTPDFileHandler {
}
return rewriteMethod(targetClass, "respond").invoke(null, new Object[] {request, args, switchboard, os});
} catch (final Throwable e) {
- theLogger.logSevere("INTERNAL ERROR: " + e.toString() + ":" +
+ theLogger.severe("INTERNAL ERROR: " + e.toString() + ":" +
e.getMessage() +
" target exception at " + targetClass + ": " +
"; java.awt.graphicsenv='" + System.getProperty("java.awt.graphicsenv","") + "'");
- Log.logException(e);
- Log.logException(e.getCause());
- if (e instanceof InvocationTargetException) Log.logException(((InvocationTargetException) e).getTargetException());
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e.getCause());
+ if (e instanceof InvocationTargetException) ConcurrentLog.logException(((InvocationTargetException) e).getTargetException());
return null;
}
}
@@ -1435,13 +1435,13 @@ public final class HTTPDFileHandler {
try {
return (String) rewriteMethod(targetClass, "mime").invoke(null, new Object[] {request, args, switchboard});
} catch (final Throwable e) {
- theLogger.logSevere("INTERNAL ERROR: " + e.toString() + ":" +
+ theLogger.severe("INTERNAL ERROR: " + e.toString() + ":" +
e.getMessage() +
" target exception at " + targetClass + ": " +
"; java.awt.graphicsenv='" + System.getProperty("java.awt.graphicsenv","") + "'");
- Log.logException(e);
- Log.logException(e.getCause());
- if (e instanceof InvocationTargetException) Log.logException(((InvocationTargetException) e).getTargetException());
+ ConcurrentLog.logException(e);
+ ConcurrentLog.logException(e.getCause());
+ if (e instanceof InvocationTargetException) ConcurrentLog.logException(((InvocationTargetException) e).getTargetException());
return dflt;
}
}
diff --git a/source/net/yacy/server/http/HTTPDProxyHandler.java b/source/net/yacy/server/http/HTTPDProxyHandler.java
index 9218204ca..9243d7484 100644
--- a/source/net/yacy/server/http/HTTPDProxyHandler.java
+++ b/source/net/yacy/server/http/HTTPDProxyHandler.java
@@ -78,6 +78,7 @@ import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.protocol.http.ProxySettings;
import net.yacy.cora.protocol.http.ProxySettings.Protocol;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.retrieval.Request;
import net.yacy.crawler.retrieval.Response;
@@ -86,7 +87,6 @@ import net.yacy.document.parser.html.ContentTransformer;
import net.yacy.document.parser.html.Transformer;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.io.ByteCountOutputStream;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
@@ -116,7 +116,7 @@ public final class HTTPDProxyHandler {
//private Properties connectionProperties = null;
// creating a logger
- private static final Log log = new Log("PROXY");
+ private static final ConcurrentLog log = new ConcurrentLog("PROXY");
private static boolean doAccessLogging = false;
/**
@@ -137,12 +137,12 @@ public final class HTTPDProxyHandler {
htRootPath = new File(sb.getAppPath(), sb.getConfig("htRootPath","htroot"));
if (!(htRootPath.exists())) {
if(!htRootPath.mkdir())
- Log.logSevere("PROXY", "could not create htRoot "+ htRootPath);
+ ConcurrentLog.severe("PROXY", "could not create htRoot "+ htRootPath);
}
// do logger initialization
try {
- log.logInfo("Configuring proxy access logging ...");
+ log.info("Configuring proxy access logging ...");
// getting the logging manager
final LogManager manager = LogManager.getLogManager();
@@ -176,15 +176,15 @@ public final class HTTPDProxyHandler {
proxyLogger.addHandler(txtLog);
doAccessLogging = true;
- log.logInfo("Proxy access logging configuration done." +
+ log.info("Proxy access logging configuration done." +
"\n\tFilename: " + pattern +
"\n\tLimit: " + limitStr +
"\n\tCount: " + countStr);
} else {
- log.logInfo("Proxy access logging is deactivated.");
+ log.info("Proxy access logging is deactivated.");
}
} catch (final Exception e) {
- log.logSevere("Unable to configure proxy access logging.",e);
+ log.severe("Unable to configure proxy access logging.",e);
}
// load a transformer
@@ -195,7 +195,7 @@ public final class HTTPDProxyHandler {
final String f = sb.getConfig("proxyYellowList", null);
if (f != null) {
yellowList = FileUtils.loadList(new File(f));
- log.logConfig("loaded yellow-list from file " + f + ", " + yellowList.size() + " entries");
+ log.config("loaded yellow-list from file " + f + ", " + yellowList.size() + " entries");
} else {
yellowList = new HashSet<String>();
}
@@ -220,7 +220,7 @@ public final class HTTPDProxyHandler {
* Special logger instance for proxy access logging much similar
* to the squid access.log file
*/
- private static final Log proxyLog = new Log("PROXY.access");
+ private static final ConcurrentLog proxyLog = new ConcurrentLog("PROXY.access");
/**
* Reusable {@link StringBuilder} for logging
@@ -310,8 +310,8 @@ public final class HTTPDProxyHandler {
DigestURI url = null;
try {
url = HeaderFramework.getRequestURL(conProp);
- if (log.isFine()) log.logFine(reqID +" GET "+ url);
- if (log.isFinest()) log.logFinest(reqID +" header: "+ requestHeader);
+ if (log.isFine()) log.fine(reqID +" GET "+ url);
+ if (log.isFinest()) log.finest(reqID +" header: "+ requestHeader);
//redirector
if (redirectorEnabled){
@@ -325,7 +325,7 @@ public final class HTTPDProxyHandler {
url = new DigestURI(newUrl);
} catch(final MalformedURLException e){}//just keep the old one
}
- if (log.isFinest()) log.logFinest(reqID +" using redirector to "+ url);
+ if (log.isFinest()) log.finest(reqID +" using redirector to "+ url);
conProp.put(HeaderFramework.CONNECTION_PROP_HOST, url.getHost()+":"+url.getPort());
conProp.put(HeaderFramework.CONNECTION_PROP_PATH, url.getPath());
requestHeader.put(HeaderFramework.HOST, url.getHost()+":"+url.getPort());
@@ -334,7 +334,7 @@ public final class HTTPDProxyHandler {
} catch (final MalformedURLException e) {
final String errorMsg = "ERROR: internal error with url generation: host=" +
host + ", port=" + port + ", path=" + path + ", args=" + args;
- log.logSevere(errorMsg);
+ log.severe(errorMsg);
HTTPDemon.sendRespondError(conProp,countedRespond,4,501,null,errorMsg,e);
return;
}
@@ -352,7 +352,7 @@ public final class HTTPDProxyHandler {
final String hostlow = host.toLowerCase();
if (args != null) { path = path + "?" + args; }
if (Switchboard.urlBlacklist.isListed(BlacklistType.PROXY, hostlow, path)) {
- log.logInfo("AGIS blocking of host '" + hostlow + "'");
+ log.info("AGIS blocking of host '" + hostlow + "'");
HTTPDemon.sendRespondError(conProp,countedRespond,4,403,null,
"URL '" + hostlow + "' blocked by yacy proxy (blacklisted)",null);
return;
@@ -386,7 +386,7 @@ public final class HTTPDProxyHandler {
// in two of these cases we trigger a scheduler to handle newly arrived files:
// case 1 and case 3
if (cachedResponseHeader == null) {
- if (log.isFinest()) log.logFinest(reqID + " page not in cache: fulfill request from web");
+ if (log.isFinest()) log.finest(reqID + " page not in cache: fulfill request from web");
fulfillRequestFromWeb(conProp, url, requestHeader, cachedResponseHeader, countedRespond);
} else {
final Request request = new Request(
@@ -409,10 +409,10 @@ public final class HTTPDProxyHandler {
);
final byte[] cacheContent = Cache.getContent(url.hash());
if (cacheContent != null && response.isFreshForProxy()) {
- if (log.isFinest()) log.logFinest(reqID + " fulfill request from cache");
+ if (log.isFinest()) log.finest(reqID + " fulfill request from cache");
fulfillRequestFromCache(conProp, url, requestHeader, cachedResponseHeader, cacheContent, countedRespond);
} else {
- if (log.isFinest()) log.logFinest(reqID + " fulfill request from web");
+ if (log.isFinest()) log.finest(reqID + " fulfill request from web");
fulfillRequestFromWeb(conProp, url, requestHeader, cachedResponseHeader, countedRespond);
}
}
@@ -426,7 +426,7 @@ public final class HTTPDProxyHandler {
} else if (!conProp.containsKey(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_HEADER)) {
final String errorMsg = "Unexpected Error. " + e.getClass().getName() + ": " + e.getMessage();
HTTPDemon.sendRespondError(conProp,countedRespond,4,501,null,errorMsg,e);
- log.logSevere(errorMsg);
+ log.severe(errorMsg);
} else {
forceConnectionClose(conProp);
}
@@ -493,7 +493,7 @@ public final class HTTPDProxyHandler {
// send request
try {
client.GET(getUrl);
- if (log.isFinest()) log.logFinest(reqID +" response status: "+ client.getHttpResponse().getStatusLine());
+ if (log.isFinest()) log.finest(reqID +" response status: "+ client.getHttpResponse().getStatusLine());
conProp.put(HeaderFramework.CONNECTION_PROP_CLIENT_REQUEST_HEADER, requestHeader);
int statusCode = client.getHttpResponse().getStatusLine().getStatusCode();
@@ -554,7 +554,7 @@ public final class HTTPDProxyHandler {
responseHeader.put(HeaderFramework.TRANSFER_ENCODING, "chunked");
}
- if (log.isFinest()) log.logFinest(reqID +" sending response header: "+ responseHeader);
+ if (log.isFinest()) log.finest(reqID +" sending response header: "+ responseHeader);
HTTPDemon.sendRespondHeader(
conProp,
respond,
@@ -607,7 +607,7 @@ public final class HTTPDProxyHandler {
} else {
cacheArray = null;
}
- if (log.isFine()) log.logFine(reqID +" writeContent of " + url + " produced cacheArray = " + ((cacheArray == null) ? "null" : ("size=" + cacheArray.length)));
+ if (log.isFine()) log.fine(reqID +" writeContent of " + url + " produced cacheArray = " + ((cacheArray == null) ? "null" : ("size=" + cacheArray.length)));
if (sizeBeforeDelete == -1) {
// totally fresh file
@@ -616,7 +616,7 @@ public final class HTTPDProxyHandler {
Cache.store(response.url(), response.getResponseHeader(), cacheArray);
sb.toIndexer(response);
} catch (final IOException e) {
- log.logWarning("cannot write " + response.url() + " to Cache (1): " + e.getMessage(), e);
+ log.warn("cannot write " + response.url() + " to Cache (1): " + e.getMessage(), e);
}
conProp.put(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_CODE, "TCP_MISS");
} else if (cacheArray != null && sizeBeforeDelete == cacheArray.length) {
@@ -631,13 +631,13 @@ public final class HTTPDProxyHandler {
Cache.store(response.url(), response.getResponseHeader(), cacheArray);
sb.toIndexer(response);
} catch (final IOException e) {
- log.logWarning("cannot write " + response.url() + " to Cache (2): " + e.getMessage(), e);
+ log.warn("cannot write " + response.url() + " to Cache (2): " + e.getMessage(), e);
}
conProp.put(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_CODE, "TCP_REFRESH_MISS");
}
} else {
// no caching
- if (log.isFine()) log.logFine(reqID +" "+ url.toString() + " not cached." +
+ if (log.isFine()) log.fine(reqID +" "+ url.toString() + " not cached." +
" StoreError=" + ((storeError==null)?"None":storeError) +
" StoreHTCache=" + storeHTCache +
" SupportError=" + supportError);
@@ -715,7 +715,7 @@ public final class HTTPDProxyHandler {
if (requestHeader.containsKey(RequestHeader.IF_MODIFIED_SINCE)) {
// conditional request: freshness of cache for that condition was already
// checked within shallUseCache(). Now send only a 304 response
- log.logInfo("CACHE HIT/304 " + url.toString());
+ log.info("CACHE HIT/304 " + url.toString());
conProp.put(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_CODE,"TCP_REFRESH_HIT");
// setting the content length header to 0
@@ -726,7 +726,7 @@ public final class HTTPDProxyHandler {
//respondHeader(respond, "304 OK", cachedResponseHeader); // respond with 'not modified'
} else {
// unconditional request: send content of cache
- log.logInfo("CACHE HIT/203 " + url.toString());
+ log.info("CACHE HIT/203 " + url.toString());
conProp.put(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_CODE,"TCP_HIT");
// setting the content header to the proper length
@@ -750,7 +750,7 @@ public final class HTTPDProxyHandler {
// this happens if the client stops loading the file
// we do nothing here
if (conProp.containsKey(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_HEADER)) {
- log.logWarning("Error while trying to send cached message body.");
+ log.warn("Error while trying to send cached message body.");
conProp.put(HeaderFramework.CONNECTION_PROP_PERSISTENT,"close");
} else {
HTTPDemon.sendRespondError(conProp,respond,4,503,"socket error: " + e.getMessage(),"socket error: " + e.getMessage(), e);
@@ -794,12 +794,12 @@ public final class HTTPDProxyHandler {
} catch (final MalformedURLException e) {
final String errorMsg = "ERROR: internal error with url generation: host=" +
host + ", port=" + port + ", path=" + path + ", args=" + args;
- log.logSevere(errorMsg);
+ log.severe(errorMsg);
HTTPDemon.sendRespondError(conProp,respond,4,501,null,errorMsg,e);
return;
}
- if (log.isFine()) log.logFine(reqID +" HEAD "+ url);
- if (log.isFinest()) log.logFinest(reqID +" header: "+ requestHeader);
+ if (log.isFine()) log.fine(reqID +" HEAD "+ url);
+ if (log.isFinest()) log.finest(reqID +" header: "+ requestHeader);
// check the blacklist, inspired by [AS]: respond a 404 for all AGIS (all you get is shit) servers
final String hostlow = host.toLowerCase();
@@ -810,7 +810,7 @@ public final class HTTPDProxyHandler {
if (Switchboard.urlBlacklist.isListed(BlacklistType.PROXY, hostlow, remotePath)) {
HTTPDemon.sendRespondError(conProp,respond,4,403,null,
"URL '" + hostlow + "' blocked by yacy proxy (blacklisted)",null);
- log.logInfo("AGIS blocking of host '" + hostlow + "'");
+ log.info("AGIS blocking of host '" + hostlow + "'");
return;
}
@@ -830,7 +830,7 @@ public final class HTTPDProxyHandler {
// generate request-url
final String connectHost = hostPart(host, port, yAddress);
final String getUrl = "http://"+ connectHost + remotePath;
- if (log.isFinest()) log.logFinest(reqID +" using url: "+ getUrl);
+ if (log.isFinest()) log.finest(reqID +" using url: "+ getUrl);
final HTTPClient client = setupHttpClient(requestHeader, connectHost);
@@ -839,7 +839,7 @@ public final class HTTPDProxyHandler {
// res = client.HEAD(getUrl);
// if (log.isFinest()) log.logFinest(reqID +" response status: "+ res.getStatusLine());
client.HEADResponse(getUrl);
- if (log.isFinest()) log.logFinest(reqID +" response status: "+ client.getHttpResponse().getStatusLine());
+ if (log.isFinest()) log.finest(reqID +" response status: "+ client.getHttpResponse().getStatusLine());
// determine if it's an internal error of the httpc
// final ResponseHeader responseHeader = res.getResponseHeader();
@@ -856,7 +856,7 @@ public final class HTTPDProxyHandler {
prepareResponseHeader(responseHeader, client.getHttpResponse().getStatusLine().getProtocolVersion().toString());
// sending the server respond back to the client
- if (log.isFinest()) log.logFinest(reqID +" sending response header: "+ responseHeader);
+ if (log.isFinest()) log.finest(reqID +" sending response header: "+ responseHeader);
// HTTPDemon.sendRespondHeader(conProp,respond,httpVer,res.getStatusCode(),res.getStatusLine().substring(4),responseHeader);
HTTPDemon.sendRespondHeader(
conProp,
@@ -912,12 +912,12 @@ public final class HTTPDProxyHandler {
} catch (final MalformedURLException e) {
final String errorMsg = "ERROR: internal error with url generation: host=" +
host + ", port=" + port + ", path=" + path + ", args=" + args;
- log.logSevere(errorMsg);
+ log.severe(errorMsg);
HTTPDemon.sendRespondError(conProp,countedRespond,4,501,null,errorMsg,e);
return;
}
- if (log.isFine()) log.logFine(reqID +" POST "+ url);
- if (log.isFinest()) log.logFinest(reqID +" header: "+ requestHeader);
+ if (log.isFine()) log.fine(reqID +" POST "+ url);
+ if (log.isFinest()) log.finest(reqID +" header: "+ requestHeader);
prepareRequestHeader(conProp, requestHeader, host.toLowerCase());
@@ -936,7 +936,7 @@ public final class HTTPDProxyHandler {
final String connectHost = hostPart(host, port, yAddress);
final String getUrl = "http://"+ connectHost + remotePath;
- if (log.isFinest()) log.logFinest(reqID +" using url: "+ getUrl);
+ if (log.isFinest()) log.finest(reqID +" using url: "+ getUrl);
// the CONTENT_LENGTH will be added by entity and cause a ClientProtocolException if set
final int contentLength = requestHeader.getContentLength();
@@ -946,12 +946,12 @@ public final class HTTPDProxyHandler {
// check input
if(body == null) {
- log.logSevere("no body to POST!");
+ log.severe("no body to POST!");
}
try {
// sending the request
client.POST(getUrl, body, contentLength);
- if (log.isFinest()) log.logFinest(reqID +" response status: "+ client.getHttpResponse().getStatusLine());
+ if (log.isFinest()) log.finest(reqID +" response status: "+ client.getHttpResponse().getStatusLine());
int statusCode = client.getHttpResponse().getStatusLine().getStatusCode();
final ResponseHeader responseHeader = new ResponseHeader(statusCode, client.getHttpResponse().getAllHeaders());
@@ -970,7 +970,7 @@ public final class HTTPDProxyHandler {
}
// sending response headers
- if (log.isFinest()) log.logFinest(reqID +" sending response header: "+ responseHeader);
+ if (log.isFinest()) log.finest(reqID +" sending response header: "+ responseHeader);
HTTPDemon.sendRespondHeader(conProp,
countedRespond,
httpVer,
@@ -1240,7 +1240,7 @@ public final class HTTPDProxyHandler {
if (Switchboard.urlBlacklist.isListed(BlacklistType.PROXY, hostlow, path)) {
HTTPDemon.sendRespondError(conProp,clientOut,4,403,null,
"URL '" + hostlow + "' blocked by yacy proxy (blacklisted)",null);
- log.logInfo("AGIS blocking of host '" + hostlow + "'");
+ log.info("AGIS blocking of host '" + hostlow + "'");
forceConnectionClose(conProp);
return;
}
@@ -1255,7 +1255,7 @@ public final class HTTPDProxyHandler {
final ResponseHeader header = new ResponseHeader(statusCode, remoteProxy.getHttpResponse().getAllHeaders());
// outputs a logline to the serverlog with the current status
- log.logInfo("CONNECT-RESPONSE: status=" + remoteProxy.getHttpResponse().getStatusLine() + ", header=" + header.toString());
+ log.info("CONNECT-RESPONSE: status=" + remoteProxy.getHttpResponse().getStatusLine() + ", header=" + header.toString());
final boolean success = statusCode >= 200 && statusCode <= 399;
if (success) {
// replace connection details
@@ -1292,7 +1292,7 @@ public final class HTTPDProxyHandler {
"Proxy-agent: YACY" + serverCore.CRLF_STRING +
serverCore.CRLF_STRING));
- log.logInfo("SSL connection to " + host + ":" + port + " established.");
+ log.info("SSL connection to " + host + ":" + port + " established.");
// start stream passing with mediate processes
final Mediate cs = new Mediate(sslSocket, clientIn, promiscuousOut);
@@ -1349,7 +1349,7 @@ public final class HTTPDProxyHandler {
} catch (final IOException e) {
// do nothing
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
@@ -1401,7 +1401,7 @@ public final class HTTPDProxyHandler {
final String exceptionMsg = e.getMessage();
if ((exceptionMsg != null) && (exceptionMsg.indexOf("Corrupt GZIP trailer",0) >= 0)) {
// just do nothing, we leave it this way
- if (log.isFine()) log.logFine("ignoring bad gzip trail for URL " + url + " (" + e.getMessage() + ")");
+ if (log.isFine()) log.fine("ignoring bad gzip trail for URL " + url + " (" + e.getMessage() + ")");
forceConnectionClose(conProp);
} else if ((exceptionMsg != null) && (exceptionMsg.indexOf("Connection reset",0)>= 0)) {
errorMessage = "Connection reset";
@@ -1422,7 +1422,7 @@ public final class HTTPDProxyHandler {
(exceptionMsg.indexOf("server has closed connection",0) >= 0)
)) {
errorMessage = exceptionMsg;
- Log.logException(e);
+ ConcurrentLog.logException(e);
} else {
errorMessage = "Unexpected Error. " + e.getClass().getName() + ": " + e.getMessage();
unknownError = true;
@@ -1439,12 +1439,12 @@ public final class HTTPDProxyHandler {
}
} else {
if (unknownError) {
- log.logSevere("Unknown Error while processing request '" +
+ log.severe("Unknown Error while processing request '" +
conProp.get(HeaderFramework.CONNECTION_PROP_REQUESTLINE) + "':" +
"\n" + Thread.currentThread().getName() +
"\n" + errorMessage,e);
} else {
- log.logWarning("Error while processing request '" +
+ log.warn("Error while processing request '" +
conProp.get(HeaderFramework.CONNECTION_PROP_REQUESTLINE) + "':" +
"\n" + Thread.currentThread().getName() +
"\n" + errorMessage);
@@ -1666,7 +1666,7 @@ public final class HTTPDProxyHandler {
logMessage.append(mime);
// sending the logging message to the logger
- if (proxyLog.isFine()) proxyLog.logFine(logMessage.toString());
+ if (proxyLog.isFine()) proxyLog.fine(logMessage.toString());
}
}
diff --git a/source/net/yacy/server/http/HTTPDemon.java b/source/net/yacy/server/http/HTTPDemon.java
index ab50c41c0..7e6ac9600 100644
--- a/source/net/yacy/server/http/HTTPDemon.java
+++ b/source/net/yacy/server/http/HTTPDemon.java
@@ -59,11 +59,11 @@ import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.NumberTools;
import net.yacy.data.UserDB;
import net.yacy.document.parser.html.CharacterCoding;
import net.yacy.kelondro.data.meta.DigestURI;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
@@ -134,7 +134,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {
private int keepAliveRequestCount = 0;
// needed for logging
- private final static Log log = new Log("HTTPD");
+ private final static ConcurrentLog log = new ConcurrentLog("HTTPD");
// class methods
public HTTPDemon(final serverSwitch s) {
@@ -210,9 +210,9 @@ public final class HTTPDemon implements serverHandler, Cloneable {
public String error(final Throwable e) { // OBLIGATORIC FUNCTION
// return string in case of any error that occurs during communication
// is always (but not only) called if an IO-dependent exception occurrs.
- log.logSevere("Unexpected Error. " + e.getClass().getName(),e);
+ log.severe("Unexpected Error. " + e.getClass().getName(),e);
final String message = e.getMessage();
- if (message != null && message.indexOf("heap space",0) > 0) Log.logException(e);
+ if (message != null && message.indexOf("heap space",0) > 0) ConcurrentLog.logException(e);
return "501 Exception occurred: " + message;
}
@@ -427,22 +427,22 @@ public final class HTTPDemon implements serverHandler, Cloneable {
private static void logUnexpectedError(final Exception e, final String address) {
if (e instanceof InterruptedException) {
- log.logInfo("Interruption detected");
+ log.info("Interruption detected");
} else {
final String errorMsg = e.getMessage();
if (errorMsg != null) {
if (errorMsg.startsWith("Socket closed")) {
- log.logInfo("httpd shutdown detected ... (" + e.getMessage() + "), client = " +address);
+ log.info("httpd shutdown detected ... (" + e.getMessage() + "), client = " +address);
} else if ((errorMsg.startsWith("Broken pipe") || errorMsg.startsWith("Connection reset"))) {
// client closed the connection, so we just end silently
- log.logInfo("Client unexpectedly closed connection... (" + e.getMessage() + "), client = " + address);
+ log.info("Client unexpectedly closed connection... (" + e.getMessage() + "), client = " + address);
} else if (errorMsg.equals("400 Bad request")) {
- log.logInfo("Bad client request ... (" + e.getMessage() + "), client = " + address);
+ log.info("Bad client request ... (" + e.getMessage() + "), client = " + address);
} else {
- log.logSevere("Unexpected Error ... (" + e.getMessage() + "), client = " + address,e);
+ log.severe("Unexpected Error ... (" + e.getMessage() + "), client = " + address,e);
}
} else {
- log.logSevere("Unexpected Error ... (" + e.getMessage() + "), client = " + address,e);
+ log.severe("Unexpected Error ... (" + e.getMessage() + "), client = " + address,e);
}
}
}
@@ -509,7 +509,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {
final String transferEncoding = header.get(HeaderFramework.TRANSFER_ENCODING);
if (transferEncoding != null) {
if (!HeaderFramework.HTTP_VERSION_1_1.equals(httpVersion)) {
- log.logWarning("client "+ session.getName() +" uses transfer-coding with HTTP version "+ httpVersion +"!");
+ log.warn("client "+ session.getName() +" uses transfer-coding with HTTP version "+ httpVersion +"!");
}
if("chunked".equalsIgnoreCase(header.get(HeaderFramework.TRANSFER_ENCODING))) {
sessionIn = new ChunkedInputStream(session.in);
@@ -805,7 +805,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {
b.write(NumberTools.parseIntDecSubstring(s, i + 2, end));
i += end - i;
} else { // 'named' smybols
- if (log.isFine()) log.logFine("discovered yet unimplemented HTML entity '" + s.substring(i, end + 1) + "'");
+ if (log.isFine()) log.fine("discovered yet unimplemented HTML entity '" + s.substring(i, end + 1) + "'");
b.write(s.charAt(i));
}
} else {
@@ -1157,8 +1157,8 @@ public final class HTTPDemon implements serverHandler, Cloneable {
}
respond.flush();
} finally {
- if (fis != null) try { fis.close(); } catch (final Exception e) { Log.logException(e); }
- if (o != null) try { o.close(); } catch (final Exception e) { Log.logException(e); }
+ if (fis != null) try { fis.close(); } catch (final Exception e) { ConcurrentLog.logException(e); }
+ if (o != null) try { o.close(); } catch (final Exception e) { ConcurrentLog.logException(e); }
}
}
diff --git a/source/net/yacy/server/http/TemplateEngine.java b/source/net/yacy/server/http/TemplateEngine.java
index 11b73b037..fc013674e 100644
--- a/source/net/yacy/server/http/TemplateEngine.java
+++ b/source/net/yacy/server/http/TemplateEngine.java
@@ -58,7 +58,7 @@ import java.io.PushbackInputStream;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.server.serverObjects;
@@ -240,7 +240,7 @@ public final class TemplateEngine {
try{
num=Integer.parseInt(pattern.get(patternKey)); // Key contains the iteration number as string
}catch(final NumberFormatException e){
- Log.logException(e);
+ ConcurrentLog.logException(e);
num=0;
}
}
@@ -258,7 +258,7 @@ public final class TemplateEngine {
}//for
structure.append(open_endtag).append(multi_key).append(close_tagn);
} else {//transferUntil
- Log.logSevere("TEMPLATE", "No Close Key found for #{"+UTF8.String(multi_key)+"}#"); //prefix here?
+ ConcurrentLog.severe("TEMPLATE", "No Close Key found for #{"+UTF8.String(multi_key)+"}#"); //prefix here?
}
}
@@ -295,7 +295,7 @@ public final class TemplateEngine {
//TODO: better Error Handling
transferUntil(pis, keyStream, appendBytes(PP, patternName, null, null));
if(pis.available()==0){
- Log.logSevere("TEMPLATE", "No such Template: %%" + UTF8.String(patternName));
+ ConcurrentLog.severe("TEMPLATE", "No such Template: %%" + UTF8.String(patternName));
final byte[] sb = structure.getBytes();
structure.close();
text.close();
@@ -307,7 +307,7 @@ public final class TemplateEngine {
structure.append(writeTemplate(pis2, out, pattern, dflt, newPrefix(prefix,key)));
transferUntil(pis, keyStream, appendBytes(hash_brackopen_slash, key, brackclose_hash, null));
if(pis.available()==0){
- Log.logSevere("TEMPLATE", "No Close Key found for #("+UTF8.String(key)+")# (by Name)");
+ ConcurrentLog.severe("TEMPLATE", "No Close Key found for #("+UTF8.String(key)+")# (by Name)");
}
} else {
while(!found){
@@ -414,7 +414,7 @@ public final class TemplateEngine {
}
} catch (final IOException e) {
//file not found?
- Log.logSevere("FILEHANDLER","Include Error with file " + UTF8.String(filename) + ": " + e.getMessage());
+ ConcurrentLog.severe("FILEHANDLER","Include Error with file " + UTF8.String(filename) + ": " + e.getMessage());
} finally {
if (br != null) try { br.close(); br=null; } catch (final Exception e) {}
}
@@ -463,7 +463,7 @@ public final class TemplateEngine {
try {
newPrefix.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return result;
}
@@ -474,7 +474,7 @@ public final class TemplateEngine {
try {
newPrefix.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return newPrefix.getBytes();
}
@@ -488,7 +488,7 @@ public final class TemplateEngine {
try {
patternKey.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -502,7 +502,7 @@ public final class TemplateEngine {
try {
byteArray.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
return result;
}
@@ -516,7 +516,7 @@ public final class TemplateEngine {
writeTemplate(new PushbackInputStream(i, 100), System.out, h, UTF8.getBytes(args[2]));
System.out.flush();
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
diff --git a/source/net/yacy/server/serverCore.java b/source/net/yacy/server/serverCore.java
index c0a0ee0a0..399d4fce5 100644
--- a/source/net/yacy/server/serverCore.java
+++ b/source/net/yacy/server/serverCore.java
@@ -60,7 +60,7 @@ import javax.net.ssl.SSLSocketFactory;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.Domains;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.workflow.AbstractBusyThread;
import net.yacy.kelondro.workflow.BusyThread;
@@ -126,7 +126,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
boolean forceRestart = false;
public static boolean useStaticIP = false;
- protected Log log;
+ protected ConcurrentLog log;
private SSLSocketFactory sslSocketFactory = null;
private ServerSocket socket; // listener
private final int timeout; // connection time-out of the socket
@@ -148,7 +148,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
if (s.getTime() < minage) continue;
// stop thread
- this.log.logInfo("check for " + s.getName() + ": " + s.getTime() + " ms alive, stopping thread");
+ this.log.info("check for " + s.getName() + ": " + s.getTime() + " ms alive, stopping thread");
// trying to stop session
s.setStopped(true);
@@ -192,7 +192,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
this.switchboard = switchboard;
// initialize logger
- this.log = new Log("SERVER");
+ this.log = new ConcurrentLog("SERVER");
// init the ssl socket factory
this.sslSocketFactory = initSSLFactory();
@@ -211,7 +211,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
}
public synchronized void init() {
- this.log.logInfo("Initializing serverCore ...");
+ this.log.info("Initializing serverCore ...");
// read some config values
this.extendedPort = this.switchboard.getConfig("port", "8090").trim();
@@ -223,10 +223,10 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
// InetSocketAddress bindAddress = null;
this.socket = new ServerSocket();
if (this.bindPort == null || this.bindPort.equals("")) {
- this.log.logInfo("Trying to bind server to port " + this.extendedPort);
+ this.log.info("Trying to bind server to port " + this.extendedPort);
this.socket.bind(/*bindAddress = */generateSocketAddress(this.extendedPort));
} else { //bindPort set, use another port to bind than the port reachable from outside
- this.log.logInfo("Trying to bind server to port " + this.bindPort+ " with "+ this.extendedPort + "as seedPort.");
+ this.log.info("Trying to bind server to port " + this.bindPort+ " with "+ this.extendedPort + "as seedPort.");
this.socket.bind(/*bindAddress = */generateSocketAddress(this.bindPort));
}
// updating the port information
@@ -234,7 +234,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
//yacyCore.seedDB.mySeed().put(yacySeed.PORT, extendedPort);
} catch (final Exception e) {
final String errorMsg = "FATAL ERROR: " + e.getMessage() + " - probably root access rights needed. check port number";
- this.log.logSevere(errorMsg);
+ this.log.severe(errorMsg);
System.out.println(errorMsg);
System.exit(0);
}
@@ -262,7 +262,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
if (bindIP.length() > 0 && bindIP.charAt(0) == '#') {
final String interfaceName = bindIP.substring(1);
String hostName = null;
- if (this.log.isFine()) this.log.logFine("Trying to determine IP address of interface '" + interfaceName + "'.");
+ if (this.log.isFine()) this.log.fine("Trying to determine IP address of interface '" + interfaceName + "'.");
final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
if (interfaces != null) {
@@ -283,10 +283,10 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
}
}
if (hostName == null) {
- this.log.logWarning("Unable to find interface with name '" + interfaceName + "'. Binding server to all interfaces");
+ this.log.warn("Unable to find interface with name '" + interfaceName + "'. Binding server to all interfaces");
bindIP = null;
} else {
- this.log.logInfo("Binding server to interface '" + interfaceName + "' with IP '" + hostName + "'.");
+ this.log.info("Binding server to interface '" + interfaceName + "' with IP '" + hostName + "'.");
bindIP = hostName;
}
}
@@ -300,7 +300,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
@Override
public void open() {
- this.log.logConfig("* server started on " + Domains.myPublicLocalIP() + ":" + this.extendedPort);
+ this.log.config("* server started on " + Domains.myPublicLocalIP() + ":" + this.extendedPort);
}
@Override
@@ -316,7 +316,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
// idleThreadCheck();
final int jobCount = getJobCount();
this.switchboard.handleBusyState(jobCount);
- if (this.log.isFinest()) this.log.logFinest("* waiting for connections, " + jobCount + " sessions running");
+ if (this.log.isFinest()) this.log.finest("* waiting for connections, " + jobCount + " sessions running");
announceThreadBlockApply();
@@ -327,7 +327,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
if (jobCount >= this.maxBusySessions) {
terminateOldSessions(3000);
- this.log.logInfo("termination of old sessions: before = " + jobCount + ", after = " + getJobCount());
+ this.log.info("termination of old sessions: before = " + jobCount + ", after = " + getJobCount());
//if (getJobCount() < this.maxBusySessions) break;
//if (trycount++ > 5) break;
//Thread.sleep(1000); // lets try again after a short break
@@ -395,7 +395,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
//terminateOldSessions(60000);
connection.start();
} else {
- this.log.logWarning("ACCESS FROM " + cIP + " DENIED");
+ this.log.warn("ACCESS FROM " + cIP + " DENIED");
}
return true;
@@ -421,28 +421,28 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
try {
session.interrupt();
} catch (final SecurityException e ) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final ConcurrentModificationException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
// close the serverchannel and socket
try {
- this.log.logInfo("Closing server socket ...");
+ this.log.info("Closing server socket ...");
this.socket.close();
} catch (final Exception e) {
- this.log.logWarning("Unable to close the server socket.");
+ this.log.warn("Unable to close the server socket.");
}
// close all sessions
- this.log.logInfo("Closing server sessions ...");
+ this.log.info("Closing server sessions ...");
for (final Session session: getJobList()) {
session.interrupt();
//session.close();
}
- this.log.logConfig("* terminated");
+ this.log.config("* terminated");
}
public static List<Session> getJobList() {
@@ -570,7 +570,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
// closing the socket to the client
if (this.controlSocket != null) try {
this.controlSocket.close();
- serverCore.this.log.logInfo("Closing main socket of thread '" + getName() + "'");
+ serverCore.this.log.info("Closing main socket of thread '" + getName() + "'");
this.controlSocket = null;
} catch (final Exception e) {}
}
@@ -588,7 +588,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
}
public void log(final boolean outgoing, final String request) {
- if (serverCore.this.log.isFine()) serverCore.this.log.logFine(this.userAddress.getHostAddress() + "/" + this.identity + " " +
+ if (serverCore.this.log.isFine()) serverCore.this.log.fine(this.userAddress.getHostAddress() + "/" + this.identity + " " +
"[" + getJobCount() + ", " + this.commandCounter +
((outgoing) ? "] > " : "] < ") +
request);
@@ -657,12 +657,12 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
// listen for commands
listen();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Throwable e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
final Throwable targetException = (e instanceof InvocationTargetException) ? ((InvocationTargetException) e).getTargetException() : null;
- Log.logException(e.getCause());
- if (targetException != null) Log.logException(targetException);
+ ConcurrentLog.logException(e.getCause());
+ if (targetException != null) ConcurrentLog.logException(targetException);
} finally {
try {
if ((this.controlSocket != null) && (! this.controlSocket.isClosed())) {
@@ -683,7 +683,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
this.controlSocket.close();
}
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} finally {
this.controlSocket = null;
}
@@ -766,13 +766,13 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
try {
result = commandMethod.invoke(this.commandObj, parameter);
} catch (final OutOfMemoryError e) {
- serverCore.this.log.logWarning("commandMethod.invoke: OutOfMemoryError / 1 (retry1 follows)");
+ serverCore.this.log.warn("commandMethod.invoke: OutOfMemoryError / 1 (retry1 follows)");
// try again
terminateOldSessions(2000);
try {
result = commandMethod.invoke(this.commandObj, parameter);
} catch (final OutOfMemoryError e2) {
- serverCore.this.log.logWarning("commandMethod.invoke: OutOfMemoryError / 2 (retry2 follows)");
+ serverCore.this.log.warn("commandMethod.invoke: OutOfMemoryError / 2 (retry2 follows)");
// try again
Thread.sleep(1000);
result = commandMethod.invoke(this.commandObj, parameter);
@@ -812,13 +812,13 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
} catch (final InvocationTargetException e) {
- serverCore.this.log.logSevere("command execution, target exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
+ serverCore.this.log.severe("command execution, target exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
// we extract a target exception
writeLine(this.commandObj.error(e.getCause()));
writeLine(this.commandObj.error(e.getTargetException()));
break;
} catch (final NoSuchMethodException e) {
- serverCore.this.log.logSevere("command execution, method exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
+ serverCore.this.log.severe("command execution, method exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
if (!this.userAddress.isSiteLocalAddress()) {
if (serverCore.this.denyHost != null) {
serverCore.this.denyHost.put(this.userAddress.getHostAddress(), "deny"); // block client: hacker attempt
@@ -826,17 +826,17 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
}
break;
} catch (final IllegalAccessException e) {
- serverCore.this.log.logSevere("command execution, illegal access exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
+ serverCore.this.log.severe("command execution, illegal access exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
// wrong parameters: this can only be an internal problem
writeLine(this.commandObj.error(e));
break;
} catch (final ClassCastException e) {
- serverCore.this.log.logSevere("command execution, cast exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
+ serverCore.this.log.severe("command execution, cast exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
// ??
writeLine(this.commandObj.error(e));
break;
} catch (final Exception e) {
- serverCore.this.log.logSevere("command execution, generic exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
+ serverCore.this.log.severe("command execution, generic exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
// whatever happens: the thread has to survive!
writeLine("UNKNOWN REASON:" + ((this.commandObj == null) ? "no command object" : this.commandObj.error(e)));
break;
@@ -850,7 +850,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
*/
} // end of while
} catch (final IOException e) {
- serverCore.this.log.logSevere("command execution, IO exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
+ serverCore.this.log.severe("command execution, IO exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e);
}
//announceMoreExecTime(System.currentTimeMillis() - this.start);
}
@@ -913,17 +913,17 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
if (bufferSize == 0 && b == -1) return null;
return readLineBuffer.getBytes();
} catch (final ClosedByInterruptException e) {
- if (logerr) Log.logWarning("SERVER", "receive interrupted");
+ if (logerr) ConcurrentLog.warn("SERVER", "receive interrupted");
return null;
} catch (final IOException e) {
final String message = e.getMessage();
- if (logerr && !message.equals("Socket closed") && !message.equals("Connection reset") && !message.equals("Read timed out")) Log.logWarning("SERVER", "receive closed by IOException: " + e.getMessage());
+ if (logerr && !message.equals("Socket closed") && !message.equals("Connection reset") && !message.equals("Read timed out")) ConcurrentLog.warn("SERVER", "receive closed by IOException: " + e.getMessage());
return null;
} finally {
try {
readLineBuffer.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -975,9 +975,9 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
try {
Thread.sleep(this.delay);
} catch (final InterruptedException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
// signaling restart
@@ -1008,7 +1008,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
}
if (pkcs12ImportFile.length() > 0) {
- this.log.logInfo("Import certificates from import file '" + pkcs12ImportFile + "'.");
+ this.log.info("Import certificates from import file '" + pkcs12ImportFile + "'.");
try {
// getting the password
@@ -1044,41 +1044,41 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
// TODO: should we do this
} catch (final Exception e) {
- this.log.logSevere("Unable to import certificate from import file '" + pkcs12ImportFile + "'.",e);
+ this.log.severe("Unable to import certificate from import file '" + pkcs12ImportFile + "'.",e);
}
} else if (keyStoreFileName.isEmpty()) return null;
// get the ssl context
try {
- this.log.logInfo("Initializing SSL support ...");
+ this.log.info("Initializing SSL support ...");
// creating a new keystore instance of type (java key store)
- if (this.log.isFine()) this.log.logFine("Initializing keystore ...");
+ if (this.log.isFine()) this.log.fine("Initializing keystore ...");
final KeyStore ks = KeyStore.getInstance("JKS");
// loading keystore data from file
- if (this.log.isFine()) this.log.logFine("Loading keystore file " + keyStoreFileName);
+ if (this.log.isFine()) this.log.fine("Loading keystore file " + keyStoreFileName);
final FileInputStream stream = new FileInputStream(keyStoreFileName);
ks.load(stream, keyStorePwd.toCharArray());
stream.close();
// creating a keystore factory
- if (this.log.isFine()) this.log.logFine("Initializing key manager factory ...");
+ if (this.log.isFine()) this.log.fine("Initializing key manager factory ...");
final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(ks,keyStorePwd.toCharArray());
// initializing the ssl context
- if (this.log.isFine()) this.log.logFine("Initializing SSL context ...");
+ if (this.log.isFine()) this.log.fine("Initializing SSL context ...");
final SSLContext sslcontext = SSLContext.getInstance("TLS");
sslcontext.init(kmf.getKeyManagers(), null, null);
final SSLSocketFactory factory = sslcontext.getSocketFactory();
- this.log.logInfo("SSL support initialized successfully");
+ this.log.info("SSL support initialized successfully");
return factory;
} catch (final Exception e) {
final String errorMsg = "FATAL ERROR: Unable to initialize the SSL Socket factory. " + e.getMessage();
- this.log.logSevere(errorMsg);
+ this.log.severe(errorMsg);
System.out.println(errorMsg);
System.exit(0);
return null;
diff --git a/source/net/yacy/server/serverSwitch.java b/source/net/yacy/server/serverSwitch.java
index 8096d6a6c..2c55fa8a2 100644
--- a/source/net/yacy/server/serverSwitch.java
+++ b/source/net/yacy/server/serverSwitch.java
@@ -46,7 +46,7 @@ import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.http.HTTPClient;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.workflow.BusyThread;
import net.yacy.kelondro.workflow.WorkflowThread;
@@ -62,7 +62,7 @@ public class serverSwitch
public final File dataPath;
public final File appPath;
protected boolean firstInit;
- protected Log log;
+ protected ConcurrentLog log;
protected int serverJobs;
private ConcurrentMap<String, String> configProps;
private final ConcurrentMap<String, String> configRemoved;
@@ -159,11 +159,11 @@ public class serverSwitch
}
// a logger for this switchboard
- public void setLog(final Log log) {
+ public void setLog(final ConcurrentLog log) {
this.log = log;
}
- public Log getLog() {
+ public ConcurrentLog getLog() {
return this.log;
}
diff --git a/source/net/yacy/server/serverSwitchAbstractAction.java b/source/net/yacy/server/serverSwitchAbstractAction.java
index fac3a1256..06881f5ff 100644
--- a/source/net/yacy/server/serverSwitchAbstractAction.java
+++ b/source/net/yacy/server/serverSwitchAbstractAction.java
@@ -21,11 +21,11 @@
package net.yacy.server;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public abstract class serverSwitchAbstractAction {
- protected Log log = null;
+ protected ConcurrentLog log = null;
private String shortDescr = "", longDescr = "";
public void setDescription(final String shortText, final String longText) {
@@ -44,7 +44,7 @@ public abstract class serverSwitchAbstractAction {
return this.longDescr;
}
- public void setLog(final Log log) {
+ public void setLog(final ConcurrentLog log) {
// defines a log where process states can be written to
this.log = log;
}
diff --git a/source/net/yacy/utils/UPnP.java b/source/net/yacy/utils/UPnP.java
index 96b092379..f7b7df389 100644
--- a/source/net/yacy/utils/UPnP.java
+++ b/source/net/yacy/utils/UPnP.java
@@ -31,7 +31,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import net.yacy.cora.protocol.Domains;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.upnp.DiscoveryAdvertisement;
@@ -42,7 +42,7 @@ import net.yacy.upnp.messages.UPNPResponseException;
public class UPnP {
- public final static Log log = new Log("UPNP");
+ public final static ConcurrentLog log = new ConcurrentLog("UPNP");
private static Switchboard sb = Switchboard.getSwitchboard();
private final static int discoveryTimeout = 5000; // seconds to receive a response from devices
@@ -73,18 +73,18 @@ public class UPnP {
try {
if (IGDs == null) IGDs = InternetGatewayDevice.getDevices(discoveryTimeout);
localHostIP = Domains.myPublicLocalIP().getHostAddress();
- if (localHostIP.startsWith("127.")) log.logWarning("found odd local address: " + localHostIP + "; UPnP may fail");
+ if (localHostIP.startsWith("127.")) log.warn("found odd local address: " + localHostIP + "; UPnP may fail");
} catch (IOException e) {
init = false;
}
if (IGDs != null) {
for (InternetGatewayDevice IGD : IGDs) {
- log.logInfo("found device: " + IGD.getIGDRootDevice().getFriendlyName());
+ log.info("found device: " + IGD.getIGDRootDevice().getFriendlyName());
}
} else {
- log.logInfo("no device found");
+ log.info("no device found");
init = false;
- log.logInfo("listening for device");
+ log.info("listening for device");
Listener.register();
}
@@ -118,11 +118,11 @@ public class UPnP {
boolean mapped = IGD.addPortMapping(mappedName, getRemoteHost(), port, port, localHostIP, 0, mappedProtocol);
String msg = "port " + port + " on device "+ IGD.getIGDRootDevice().getFriendlyName();
if (mapped) {
- log.logInfo("mapped " + msg);
+ log.info("mapped " + msg);
mappedPort = port;
}
- else log.logWarning("could not map " + msg);
- } catch (IOException e) {} catch (UPNPResponseException e) { log.logSevere("mapping error: " + e.getMessage()); }
+ else log.warn("could not map " + msg);
+ } catch (IOException e) {} catch (UPNPResponseException e) { log.severe("mapping error: " + e.getMessage()); }
}
}
}
@@ -136,9 +136,9 @@ public class UPnP {
try {
boolean unmapped = IGD.deletePortMapping(getRemoteHost(), mappedPort, mappedProtocol);
String msg = "port " + mappedPort + " on device "+ IGD.getIGDRootDevice().getFriendlyName();
- if (unmapped) log.logInfo("unmapped " + msg);
- else log.logWarning("could not unmap " + msg);
- } catch (IOException e) {} catch (UPNPResponseException e) { log.logSevere("unmapping error: " + e.getMessage()); }
+ if (unmapped) log.info("unmapped " + msg);
+ else log.warn("could not unmap " + msg);
+ } catch (IOException e) {} catch (UPNPResponseException e) { log.severe("unmapping error: " + e.getMessage()); }
}
mappedPort = 0; // reset mapped port
}
@@ -199,9 +199,9 @@ public class UPnP {
errorMsg = e.getMessage();
}
if (error && errorMsg != null)
- log.logSevere("eventSSDPAlive: " + errorMsg);
+ log.severe("eventSSDPAlive: " + errorMsg);
if (newIGD[0] == null) return;
- log.logInfo("discovered device: " + newIGD[0].getIGDRootDevice().getFriendlyName());
+ log.info("discovered device: " + newIGD[0].getIGDRootDevice().getFriendlyName());
if (UPnP.setIGDs(newIGD) &&
Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.UPNP_ENABLED, false))
UPnP.addPortMapping();
diff --git a/source/net/yacy/utils/crypt.java b/source/net/yacy/utils/crypt.java
index 856ac3430..45e21c55f 100644
--- a/source/net/yacy/utils/crypt.java
+++ b/source/net/yacy/utils/crypt.java
@@ -27,7 +27,7 @@ package net.yacy.utils;
import java.util.Random;
import net.yacy.cora.order.Base64Order;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class crypt {
@@ -96,7 +96,7 @@ public class crypt {
try {
return gzip.gunzipString(Base64Order.enhancedCoder.decode(encoded.substring(2)));
} catch (final Exception e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
case 'p': {
diff --git a/source/net/yacy/utils/cryptbig.java b/source/net/yacy/utils/cryptbig.java
index 5a3aa1e69..445484ca7 100644
--- a/source/net/yacy/utils/cryptbig.java
+++ b/source/net/yacy/utils/cryptbig.java
@@ -59,7 +59,7 @@ import net.yacy.cora.document.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.order.Digest;
import net.yacy.cora.util.CommonPattern;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class cryptbig {
@@ -214,7 +214,7 @@ public class cryptbig {
System.out.println(decrypted);
} catch (final Exception e) {
System.out.println("Exception: " + e.getMessage());
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -615,7 +615,7 @@ public class cryptbig {
System.out.println(descrambleString(s[1], s[2]));
} catch (final IOException e) {
// TODO Auto-generated catch block
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
System.out.println("Calculation time: " + (System.currentTimeMillis() - t) + " milliseconds");
System.exit(0);
diff --git a/source/net/yacy/utils/gzip.java b/source/net/yacy/utils/gzip.java
index c2a012456..3fefbbec0 100644
--- a/source/net/yacy/utils/gzip.java
+++ b/source/net/yacy/utils/gzip.java
@@ -39,12 +39,12 @@ import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import net.yacy.cora.document.UTF8;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class gzip {
- private static Log logger = new Log("GZIP");
+ private static ConcurrentLog logger = new ConcurrentLog("GZIP");
public static void gzipFile(final String inFile, final String outFile) {
try {
@@ -54,9 +54,9 @@ public class gzip {
fin.close();
fout.close();
} catch (final FileNotFoundException e) {
- logger.logWarning("ERROR: file '" + inFile + "' not found", e);
+ logger.warn("ERROR: file '" + inFile + "' not found", e);
} catch (final IOException e) {
- logger.logWarning("ERROR: IO trouble ",e);
+ logger.warn("ERROR: IO trouble ",e);
}
}
@@ -76,9 +76,9 @@ public class gzip {
fin.close();
fout.close();
} catch (final FileNotFoundException e) {
- logger.logWarning("ERROR: file '" + inFile + "' not found", e);
+ logger.warn("ERROR: file '" + inFile + "' not found", e);
} catch (final IOException e) {
- logger.logWarning("ERROR: IO trouble ",e);
+ logger.warn("ERROR: IO trouble ",e);
}
}
@@ -93,7 +93,7 @@ public class gzip {
fout.close();
return baos.toByteArray();
} catch (final IOException e) {
- logger.logWarning("ERROR: IO trouble ",e);
+ logger.warn("ERROR: IO trouble ",e);
return null;
}
}
diff --git a/source/net/yacy/utils/tarTools.java b/source/net/yacy/utils/tarTools.java
index 289a25781..1512a8d86 100644
--- a/source/net/yacy/utils/tarTools.java
+++ b/source/net/yacy/utils/tarTools.java
@@ -33,7 +33,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import org.apache.tools.tar.TarEntry;
import org.apache.tools.tar.TarInputStream;
@@ -67,7 +67,7 @@ public class tarTools {
* @throws Exception (IOException or FileNotFoundException)
*/
public static void unTar(final InputStream in, final String untarDir) throws Exception{
- Log.logInfo("UNTAR", "starting");
+ ConcurrentLog.info("UNTAR", "starting");
if(new File(untarDir).exists()){
final TarInputStream tin = new TarInputStream(in);
TarEntry tarEntry = tin.getNextEntry();
@@ -85,9 +85,9 @@ public class tarTools {
}
tin.close();
} else { // untarDir doesn't exist
- Log.logWarning("UNTAR", "destination " + untarDir + " doesn't exist.");
+ ConcurrentLog.warn("UNTAR", "destination " + untarDir + " doesn't exist.");
}
- Log.logInfo("UNTAR", "finished");
+ ConcurrentLog.info("UNTAR", "finished");
}
public static void main(final String args[]) {
diff --git a/source/net/yacy/visualization/Captcha.java b/source/net/yacy/visualization/Captcha.java
index 74ececf11..7484d3100 100644
--- a/source/net/yacy/visualization/Captcha.java
+++ b/source/net/yacy/visualization/Captcha.java
@@ -27,7 +27,7 @@ import java.util.Random;
import javax.imageio.ImageIO;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class Captcha extends RasterPlotter {
@@ -86,7 +86,7 @@ public class Captcha extends RasterPlotter {
try {
ImageIO.write(m.getImage(), "png", new java.io.File(args[0]));
} catch (final java.io.IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
diff --git a/source/net/yacy/visualization/ChartPlotter.java b/source/net/yacy/visualization/ChartPlotter.java
index f6937b637..17a69e3d4 100644
--- a/source/net/yacy/visualization/ChartPlotter.java
+++ b/source/net/yacy/visualization/ChartPlotter.java
@@ -29,7 +29,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
public class ChartPlotter extends RasterPlotter {
@@ -185,7 +185,7 @@ public class ChartPlotter extends RasterPlotter {
//ImageIO.write(ip.getImage(), "png", fos);
fos.close();
} catch (final IOException e) {}
- Log.shutdown();
+ ConcurrentLog.shutdown();
}
}
diff --git a/source/net/yacy/visualization/RasterPlotter.java b/source/net/yacy/visualization/RasterPlotter.java
index ff596eb27..ca0545b87 100644
--- a/source/net/yacy/visualization/RasterPlotter.java
+++ b/source/net/yacy/visualization/RasterPlotter.java
@@ -55,13 +55,13 @@ import java.util.zip.DeflaterOutputStream;
import javax.imageio.ImageIO;
-import net.yacy.kelondro.logging.Log;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.util.ByteBuffer;
public class RasterPlotter {
- public final Log log = new Log("RasterPlotter");
+ public final ConcurrentLog log = new ConcurrentLog("RasterPlotter");
public static final double PI180 = Math.PI / 180.0d;
public static final double PI4 = Math.PI / 4.0d;
@@ -290,7 +290,7 @@ public class RasterPlotter {
setPixel(x, y, c);
}
} catch (ArrayIndexOutOfBoundsException e) {
- this.log.logWarning(e.getMessage() + ": x = " + x + ", y = " + y);
+ this.log.warn(e.getMessage() + ": x = " + x + ", y = " + y);
} // may appear when pixel coordinate is out of bounds
}
@@ -920,7 +920,7 @@ public class RasterPlotter {
return baos;
} catch (final IOException e) {
// should not happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -936,7 +936,7 @@ public class RasterPlotter {
return baos;
} catch (IOException e) {
// should not happen
- Log.logException(e);
+ ConcurrentLog.logException(e);
return null;
}
}
@@ -1034,7 +1034,7 @@ public class RasterPlotter {
ImageIO.write(m.getImage(), "png", fos);
fos.close();
} catch (final IOException e) {}
- Log.shutdown();
+ ConcurrentLog.shutdown();
// open file automatically, works only on Mac OS X
/*
diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java
index b1f1a5e31..77dc5d67d 100644
--- a/source/net/yacy/yacy.java
+++ b/source/net/yacy/yacy.java
@@ -48,10 +48,10 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.TimeoutRequest;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.sorting.Array;
+import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.Translator;
import net.yacy.gui.YaCyApp;
import net.yacy.gui.framework.Browser;
-import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.Formatter;
import net.yacy.kelondro.util.MemoryControl;
@@ -167,23 +167,23 @@ public final class yacy {
System.out.println("could not copy yacy.logging");
}
try{
- Log.configureLogging(dataHome, appHome, new File(dataHome, "DATA/LOG/yacy.logging"));
+ ConcurrentLog.configureLogging(dataHome, appHome, new File(dataHome, "DATA/LOG/yacy.logging"));
} catch (final IOException e) {
System.out.println("could not find logging properties in homePath=" + dataHome);
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
- Log.logConfig("STARTUP", "YaCy version: " + yacyBuildProperties.getVersion() + "/" + yacyBuildProperties.getSVNRevision());
- Log.logConfig("STARTUP", "Java version: " + System.getProperty("java.version", "no-java-version"));
- Log.logConfig("STARTUP", "Operation system: " + System.getProperty("os.name","unknown"));
- Log.logConfig("STARTUP", "Application root-path: " + appHome);
- Log.logConfig("STARTUP", "Data root-path: " + dataHome);
- Log.logConfig("STARTUP", "Time zone: UTC" + GenericFormatter.UTCDiffString() + "; UTC+0000 is " + System.currentTimeMillis());
- Log.logConfig("STARTUP", "Maximum file system path length: " + OS.maxPathLength);
+ ConcurrentLog.config("STARTUP", "YaCy version: " + yacyBuildProperties.getVersion() + "/" + yacyBuildProperties.getSVNRevision());
+ ConcurrentLog.config("STARTUP", "Java version: " + System.getProperty("java.version", "no-java-version"));
+ ConcurrentLog.config("STARTUP", "Operation system: " + System.getProperty("os.name","unknown"));
+ ConcurrentLog.config("STARTUP", "Application root-path: " + appHome);
+ ConcurrentLog.config("STARTUP", "Data root-path: " + dataHome);
+ ConcurrentLog.config("STARTUP", "Time zone: UTC" + GenericFormatter.UTCDiffString() + "; UTC+0000 is " + System.currentTimeMillis());
+ ConcurrentLog.config("STARTUP", "Maximum file system path length: " + OS.maxPathLength);
f = new File(dataHome, "DATA/yacy.running");
final String conf = "DATA/SETTINGS/yacy.conf".replace("/", File.separator);
if (f.exists()) { // another instance running? VM crash? User will have to care about this
- Log.logSevere("STARTUP", "WARNING: the file " + f + " exists, this usually means that a YaCy instance is still running. If you want to restart YaCy, try first ./stopYACY.sh, then ./startYACY.sh. If ./stopYACY.sh fails, try ./killYACY.sh");
+ ConcurrentLog.severe("STARTUP", "WARNING: the file " + f + " exists, this usually means that a YaCy instance is still running. If you want to restart YaCy, try first ./stopYACY.sh, then ./startYACY.sh. If ./stopYACY.sh fails, try ./killYACY.sh");
// If YaCy is actually running, then we check if the server port is open.
// If yes, then we consider that a restart is a user mistake and then we just respond
@@ -200,18 +200,18 @@ public final class yacy {
if (TimeoutRequest.ping("127.0.0.1", port, 1000)) {
Browser.openBrowser("http://localhost:" + port + "/" + p.getProperty(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"));
// Thats it; YaCy was running, the user is happy, we can stop now.
- Log.logSevere("STARTUP", "WARNING: YaCy instance was still running; just opening the browser and exit.");
+ ConcurrentLog.severe("STARTUP", "WARNING: YaCy instance was still running; just opening the browser and exit.");
System.exit(0);
}
} catch (ExecutionException ex) {
- Log.logInfo("STARTUP", "INFO: delete old yacy.running file; likely previous YaCy session was not orderly shutdown!");
+ ConcurrentLog.info("STARTUP", "INFO: delete old yacy.running file; likely previous YaCy session was not orderly shutdown!");
}
}
// YaCy is not running; thus delete the file an go on as nothing was wrong.
delete(f);
}
- if (!f.createNewFile()) Log.logSevere("STARTUP", "WARNING: the file " + f + " can not be created!");
+ if (!f.createNewFile()) ConcurrentLog.severe("STARTUP", "WARNING: the file " + f + " can not be created!");
try { new FileOutputStream(f).write(Integer.toString(OS.getPID()).getBytes()); } catch (final Exception e) { } // write PID
f.deleteOnExit();
FileChannel channel = null;
@@ -224,7 +224,7 @@ public final class yacy {
try {
sb = new Switchboard(dataHome, appHome, "defaults/yacy.init".replace("/", File.separator), conf);
} catch (final RuntimeException e) {
- Log.logSevere("STARTUP", "YaCy cannot start: " + e.getMessage(), e);
+ ConcurrentLog.severe("STARTUP", "YaCy cannot start: " + e.getMessage(), e);
System.exit(-1);
}
//sbSync.V(); // signal that the sb reference was set
@@ -311,7 +311,7 @@ public final class yacy {
try {
JenaTripleStore.load(new File(triplestore, s).getAbsolutePath());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -321,7 +321,7 @@ public final class yacy {
try {
JenaTripleStore.load(local.getAbsolutePath());
} catch (IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -387,7 +387,7 @@ public final class yacy {
Formatter.setLocale(lang);
// registering shutdown hook
- Log.logConfig("STARTUP", "Registering Shutdown Hook");
+ ConcurrentLog.config("STARTUP", "Registering Shutdown Hook");
final Runtime run = Runtime.getRuntime();
run.addShutdownHook(new shutdownHookThread(Thread.currentThread(), sb));
@@ -404,11 +404,11 @@ public final class yacy {
try {
sb.waitForShutdown();
} catch (final Exception e) {
- Log.logSevere("MAIN CONTROL LOOP", "PANIC: " + e.getMessage(),e);
+ ConcurrentLog.severe("MAIN CONTROL LOOP", "PANIC: " + e.getMessage(),e);
}
// shut down
Array.terminate();
- Log.logConfig("SHUTDOWN", "caught termination signal");
+ ConcurrentLog.config("SHUTDOWN", "caught termination signal");
server.terminate(false);
server.interrupt();
server.close();
@@ -417,16 +417,16 @@ public final class yacy {
if (server.isAlive()) {
server.interrupt();
}
- Log.logConfig("SHUTDOWN", "server has terminated");
+ ConcurrentLog.config("SHUTDOWN", "server has terminated");
sb.close();
} catch (final Exception e) {
- Log.logSevere("STARTUP", "Unexpected Error: " + e.getClass().getName(),e);
+ ConcurrentLog.severe("STARTUP", "Unexpected Error: " + e.getClass().getName(),e);
//System.exit(1);
}
if(lock != null) lock.release();
if(channel != null) channel.close();
} catch (final Exception ee) {
- Log.logSevere("STARTUP", "FATAL ERROR: " + ee.getMessage(),ee);
+ ConcurrentLog.severe("STARTUP", "FATAL ERROR: " + ee.getMessage(),ee);
} finally {
}
@@ -435,8 +435,8 @@ public final class yacy {
JenaTripleStore.saveAll();
}
- Log.logConfig("SHUTDOWN", "goodbye. (this is the last line)");
- Log.shutdown();
+ ConcurrentLog.config("SHUTDOWN", "goodbye. (this is the last line)");
+ ConcurrentLog.shutdown();
shutdownSemaphore.release(1000);
try {
System.exit(0);
@@ -448,7 +448,7 @@ public final class yacy {
*/
private static void delete(final File f) {
if(!f.delete())
- Log.logSevere("STARTUP", "WARNING: the file " + f + " can not be deleted!");
+ ConcurrentLog.severe("STARTUP", "WARNING: the file " + f + " can not be deleted!");
}
/**
@@ -458,7 +458,7 @@ public final class yacy {
private static void mkdirIfNeseccary(final File path) {
if (!(path.exists()))
if(!path.mkdir())
- Log.logWarning("STARTUP", "could not create directory "+ path.toString());
+ ConcurrentLog.warn("STARTUP", "could not create directory "+ path.toString());
}
/**
@@ -468,7 +468,7 @@ public final class yacy {
public static void mkdirsIfNeseccary(final File path) {
if (!(path.exists()))
if(!path.mkdirs())
- Log.logWarning("STARTUP", "could not create directories "+ path.toString());
+ ConcurrentLog.warn("STARTUP", "could not create directories "+ path.toString());
}
/**
@@ -482,12 +482,12 @@ public final class yacy {
* @return Properties read from the configurationfile.
*/
private static Properties configuration(final String mes, final File homePath) {
- Log.logConfig(mes, "Application Root Path: " + homePath.toString());
+ ConcurrentLog.config(mes, "Application Root Path: " + homePath.toString());
// read data folder
final File dataFolder = new File(homePath, "DATA");
if (!(dataFolder.exists())) {
- Log.logSevere(mes, "Application was never started or root path wrong.");
+ ConcurrentLog.severe(mes, "Application was never started or root path wrong.");
System.exit(-1);
}
@@ -497,17 +497,17 @@ public final class yacy {
fis = new FileInputStream(new File(homePath, "DATA/SETTINGS/yacy.conf"));
config.load(fis);
} catch (final FileNotFoundException e) {
- Log.logSevere(mes, "could not find configuration file.");
+ ConcurrentLog.severe(mes, "could not find configuration file.");
System.exit(-1);
} catch (final IOException e) {
- Log.logSevere(mes, "could not read configuration file.");
+ ConcurrentLog.severe(mes, "could not read configuration file.");
System.exit(-1);
} finally {
if(fis != null) {
try {
fis.close();
} catch (final IOException e) {
- Log.logException(e);
+ ConcurrentLog.logException(e);
}
}
}
@@ -559,7 +559,7 @@ public final class yacy {
// read response
// if (res.getStatusLine().startsWith("2")) {
if (con.getStatusCode() > 199 && con.getStatusCode() < 300) {
- Log.logConfig("COMMAND-STEERING", "YACY accepted steering command: " + processdescription);
+ ConcurrentLog.config("COMMAND-STEERING", "YACY accepted steering command: " + processdescription);
// final ByteArrayOutputStream bos = new ByteArrayOutputStream(); //This is stream is not used???
// try {
// FileUtils.copyToStream(new BufferedInputStream(res.getDataAsStream()), new BufferedOutputStream(bos));
@@ -568,11 +568,11 @@ public final class yacy {
// }
} else {
// Log.logSevere("COMMAND-STEERING", "error response from YACY socket: " + res.getStatusLine());
- Log.logSevere("COMMAND-STEERING", "error response from YACY socket: " + con.getHttpResponse().getStatusLine());
+ ConcurrentLog.severe("COMMAND-STEERING", "error response from YACY socket: " + con.getHttpResponse().getStatusLine());
System.exit(-1);
}
} catch (final IOException e) {
- Log.logSevere("COMMAND-STEERING", "could not establish connection to YACY socket: " + e.getMessage());
+ ConcurrentLog.severe("COMMAND-STEERING", "could not establish connection to YACY socket: " + e.getMessage());
System.exit(-1);
// } finally {
// // release connection
@@ -588,7 +588,7 @@ public final class yacy {
}
// finished
- Log.logConfig("COMMAND-STEERING", "SUCCESSFULLY FINISHED COMMAND: " + processdescription);
+ ConcurrentLog.config("COMMAND-STEERING", "SUCCESSFULLY FINISHED COMMAND: " + processdescription);
}
/**
@@ -655,7 +655,7 @@ public final class yacy {
startup(dataRoot, applicationRoot, startupMemFree, startupMemTotal, false);
}
} finally {
- Log.shutdown();
+ ConcurrentLog.shutdown();
}
}
}
@@ -678,20 +678,20 @@ class shutdownHookThread extends Thread {
public void run() {
try {
if (!this.sb.isTerminated()) {
- Log.logConfig("SHUTDOWN","Shutdown via shutdown hook.");
+ ConcurrentLog.config("SHUTDOWN","Shutdown via shutdown hook.");
// sending the yacy main thread a shutdown signal
- Log.logFine("SHUTDOWN","Signaling shutdown to the switchboard.");
+ ConcurrentLog.fine("SHUTDOWN","Signaling shutdown to the switchboard.");
this.sb.terminate("shutdown hook");
// waiting for the yacy thread to finish execution
- Log.logFine("SHUTDOWN","Waiting for main thread to finish.");
+ ConcurrentLog.fine("SHUTDOWN","Waiting for main thread to finish.");
if (this.mainThread.isAlive() && !this.sb.isTerminated()) {
this.mainThread.join();
}
}
} catch (final Exception e) {
- Log.logSevere("SHUTDOWN","Unexpected error. " + e.getClass().getName(),e);
+ ConcurrentLog.severe("SHUTDOWN","Unexpected error. " + e.getClass().getName(),e);
}
}
}