Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Fixed LogUtil : now works with underlying log facade

Julien Nioche8eaa157a2f02
diff --git a/src/java/org/apache/nutch/util/LogUtil.java b/src/java/org/apache/nutch/util/LogUtil.java
index ae4f5e92b..963d0db22 100644
--- a/src/java/org/apache/nutch/util/LogUtil.java
+++ b/src/java/org/apache/nutch/util/LogUtil.java
@@ -42,15 +42,15 @@ public class LogUtil {
private static Method WARN = null;
private static Method ERROR = null;
private static Method FATAL = null;
-
+
static {
try {
- TRACE = Logger.class.getMethod("trace", new Class[] { Object.class });
- DEBUG = Logger.class.getMethod("debug", new Class[] { Object.class });
- INFO = Logger.class.getMethod("info", new Class[] { Object.class });
- WARN = Logger.class.getMethod("warn", new Class[] { Object.class });
- ERROR = Logger.class.getMethod("error", new Class[] { Object.class });
- FATAL = Logger.class.getMethod("fatal", new Class[] { Object.class });
+ TRACE = Logger.class.getMethod("trace", new Class[] { String.class });
+ DEBUG = Logger.class.getMethod("debug", new Class[] { String.class });
+ INFO = Logger.class.getMethod("info", new Class[] { String.class });
+ WARN = Logger.class.getMethod("warn", new Class[] { String.class });
+ ERROR = Logger.class.getMethod("error", new Class[] { String.class });
+ FATAL = Logger.class.getMethod("error", new Class[] { String.class });
} catch(Exception e) {
if (LOG.isErrorEnabled()) {
LOG.error("Cannot init log methods", e);
@@ -100,7 +100,7 @@ public class LogUtil {
if (!hasNewline())
return;
try {
- method.invoke(logger, new Object[] { toString().trim() });
+ method.invoke(logger, new String[] { toString().trim() });
} catch (Exception e) {
if (LOG.isErrorEnabled()) {
LOG.error("Cannot log with method [" + method + "]", e);