aboutsummaryrefslogtreecommitdiffstats
path: root/android/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'android/src/main')
-rw-r--r--android/src/main/AndroidManifest.xml3
-rw-r--r--android/src/main/java/org/whispersystems/libaxolotl/util/AndroidAxolotlLogger.java24
2 files changed, 27 insertions, 0 deletions
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..85f0fe6b
--- /dev/null
+++ b/android/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.whispersystems.libaxolotl">
+</manifest>
diff --git a/android/src/main/java/org/whispersystems/libaxolotl/util/AndroidAxolotlLogger.java b/android/src/main/java/org/whispersystems/libaxolotl/util/AndroidAxolotlLogger.java
new file mode 100644
index 00000000..302c08a4
--- /dev/null
+++ b/android/src/main/java/org/whispersystems/libaxolotl/util/AndroidAxolotlLogger.java
@@ -0,0 +1,24 @@
+package org.whispersystems.libaxolotl.util;
+
+import android.util.Log;
+import android.util.SparseIntArray;
+
+import org.whispersystems.libaxolotl.logging.AxolotlLogger;
+
+public class AndroidAxolotlLogger implements AxolotlLogger {
+
+ private static final SparseIntArray PRIORITY_MAP = new SparseIntArray(5) {{
+ put(AxolotlLogger.INFO, Log.INFO);
+ put(AxolotlLogger.ASSERT, Log.ASSERT);
+ put(AxolotlLogger.DEBUG, Log.DEBUG);
+ put(AxolotlLogger.VERBOSE, Log.VERBOSE);
+ put(AxolotlLogger.WARN, Log.WARN);
+
+ }};
+
+ @Override
+ public void log(int priority, String tag, String message) {
+ int androidPriority = PRIORITY_MAP.get(priority, Log.WARN);
+ Log.println(androidPriority, tag, message);
+ }
+}