Move log tag to Constants

This commit is contained in:
str4d
2014-12-27 23:14:34 +00:00
parent f25bd2d8c1
commit e7f671ecfb
2 changed files with 10 additions and 8 deletions

View File

@@ -1,6 +1,8 @@
package i2p.bote.android;
public class Constants {
public static final String ANDROID_LOG_TAG = "I2P-Bote";
public static final String EMAILDEST_SCHEME = "bote";
public static final String NDEF_DOMAIN = "i2p.bote";

View File

@@ -10,6 +10,8 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.Queue;
import i2p.bote.android.Constants;
/**
* bridge to android logging
*
@@ -118,8 +120,6 @@ class LogWriter implements Runnable {
}
}
private static final String ANDROID_LOG_TAG = "I2P-Bote";
public void log(int priority, Class<?> src, String name, String threadName, String msg) {
if (src != null) {
String tag = src.getName();
@@ -127,17 +127,17 @@ class LogWriter implements Runnable {
if (dot >= 0)
tag = tag.substring(dot + 1);
android.util.Log.println(toAndroidLevel(priority),
ANDROID_LOG_TAG,
Constants.ANDROID_LOG_TAG,
tag +
" [" + threadName + "] " + msg);
} else if (name != null)
android.util.Log.println(toAndroidLevel(priority),
ANDROID_LOG_TAG,
Constants.ANDROID_LOG_TAG,
name +
" [" + threadName + "] " + msg);
else
android.util.Log.println(toAndroidLevel(priority),
ANDROID_LOG_TAG,
Constants.ANDROID_LOG_TAG,
'[' + threadName + "] " + msg);
}
@@ -148,19 +148,19 @@ class LogWriter implements Runnable {
if (dot >= 0)
tag = tag.substring(dot + 1);
android.util.Log.println(toAndroidLevel(priority),
ANDROID_LOG_TAG,
Constants.ANDROID_LOG_TAG,
tag +
" [" + threadName + "] " + msg +
' ' + t.toString() + ' ' + android.util.Log.getStackTraceString(t));
} else if (name != null)
android.util.Log.println(toAndroidLevel(priority),
ANDROID_LOG_TAG,
Constants.ANDROID_LOG_TAG,
name +
" [" + threadName + "] " + msg +
' ' + t.toString() + ' ' + android.util.Log.getStackTraceString(t));
else
android.util.Log.println(toAndroidLevel(priority),
ANDROID_LOG_TAG,
Constants.ANDROID_LOG_TAG,
'[' + threadName + "] " +
msg + ' ' + t.toString() + ' ' + android.util.Log.getStackTraceString(t));
}