Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidLogSystem.java |
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidLogSystem.java |
similarity index 53% |
copy from libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java |
copy to libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidLogSystem.java |
index 7e655ba71e65c7a8bfbfe9a4fa9c6b30a385ba55..bc3a3b41b2ff82a34ab26c28bc2954e89ec4f1d0 100644 |
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java |
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidLogSystem.java |
@@ -15,24 +15,34 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
-package org.adblockplus.libadblockplus; |
+package org.adblockplus.libadblockplus.android; |
-public class AdblockPlusException extends RuntimeException |
-{ |
- private static final long serialVersionUID = -8127654134450836743L; |
+import org.adblockplus.libadblockplus.LogSystem; |
- public AdblockPlusException(final String message) |
- { |
- super(message); |
- } |
+import android.util.Log; |
- public AdblockPlusException(final String message, final Throwable throwable) |
+public class AndroidLogSystem extends LogSystem |
+{ |
+ private static int abpLogLevelToAndroid(final LogLevel level) |
{ |
- super(message, throwable); |
+ switch (level) |
+ { |
+ default: |
+ case TRACE: |
+ case LOG: |
+ return Log.VERBOSE; |
+ case INFO: |
+ return Log.INFO; |
+ case WARN: |
+ return Log.WARN; |
+ case ERROR: |
+ return Log.ERROR; |
+ } |
} |
- public AdblockPlusException(final Throwable throwable) |
+ @Override |
+ public void logCallback(final LogLevel level, final String message, final String source) |
{ |
- super(throwable); |
+ Log.println(abpLogLevelToAndroid(level), source, message); |
} |
} |