summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2014-12-01 16:39:13 +0100
committerJonathan Bauer2014-12-01 16:39:13 +0100
commite9a406d5aa7f2bfdc0c617e431531fba43ed7f17 (patch)
treef406ff47dc27fa8d155a3e43ba52edf49f168cef
parenthack: log4j logger support (diff)
downloadproxy-vole-e9a406d5aa7f2bfdc0c617e431531fba43ed7f17.tar.gz
proxy-vole-e9a406d5aa7f2bfdc0c617e431531fba43ed7f17.tar.xz
proxy-vole-e9a406d5aa7f2bfdc0c617e431531fba43ed7f17.zip
Revert "hack: log4j logger support"
This reverts commit 075f086d3211f6f347e7366a5d5f78e2b73c850e.
-rw-r--r--pom.xml6
-rw-r--r--src/main/java/com/btr/proxy/search/ProxySearch.java11
-rw-r--r--src/main/java/com/btr/proxy/util/Logger.java22
3 files changed, 12 insertions, 27 deletions
diff --git a/pom.xml b/pom.xml
index c25d07d..b77cdb4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,11 +46,5 @@
<version>[4.8.0,4.15.0]</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>[1.2.10,1.2.20]</version>
- <scope>compile</scope>
- </dependency>
</dependencies>
</project>
diff --git a/src/main/java/com/btr/proxy/search/ProxySearch.java b/src/main/java/com/btr/proxy/search/ProxySearch.java
index 67fa0cf..19db95f 100644
--- a/src/main/java/com/btr/proxy/search/ProxySearch.java
+++ b/src/main/java/com/btr/proxy/search/ProxySearch.java
@@ -241,6 +241,17 @@ public class ProxySearch implements ProxySearchStrategy {
public static void main(String[] args) {
ProxySearch ps = ProxySearch.getDefaultProxySearch();
+ Logger.setBackend(new LogBackEnd() {
+
+ public void log(Class<?> clazz, LogLevel loglevel, String msg,
+ Object... params) {
+ System.out.println(MessageFormat.format(msg, params));
+ }
+
+ public boolean isLogginEnabled(LogLevel logLevel) {
+ return true;
+ }
+ });
ps.getProxySelector();
}
diff --git a/src/main/java/com/btr/proxy/util/Logger.java b/src/main/java/com/btr/proxy/util/Logger.java
index 00c1037..f434699 100644
--- a/src/main/java/com/btr/proxy/util/Logger.java
+++ b/src/main/java/com/btr/proxy/util/Logger.java
@@ -2,11 +2,6 @@ package com.btr.proxy.util;
import java.text.MessageFormat;
-import org.apache.log4j.Priority;
-
-import com.btr.proxy.search.ProxySearch;
-
-
/*****************************************************************************
* Simple logging support for the framework.
* You need to add an logging listener that needs to send the logging events
@@ -73,22 +68,7 @@ public class Logger {
************************************************************************/
public static void log(Class<?> clazz, LogLevel loglevel, String msg, Object ...params) {
- Priority priority;
- switch(loglevel) {
- case ERROR:
- priority = Priority.DEBUG;
- break;
- case WARNING:
- priority = Priority.WARN;
- break;
- case INFO:
- priority = Priority.INFO;
- break;
- default:
- priority = Priority.DEBUG;
- }
- org.apache.log4j.Logger.getLogger(clazz).log(
- clazz.getCanonicalName(), priority, MessageFormat.format(msg, params), null);
+ System.out.println(MessageFormat.format(msg, params));
}
/*************************************************************************