diff options
author | Jinghao Shi <jhshi@users.noreply.github.com> | 2017-08-22 11:01:35 -0700 |
---|---|---|
committer | Ang Li <angli@google.com> | 2017-08-22 11:01:35 -0700 |
commit | 100d1edd8f81a52c6d91e0979e07d144a89708d1 (patch) | |
tree | fbb905388460cd9b4cbebc2292fd60f5d933f90b /third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java | |
parent | d4733bee3058bd96ca30748050375d1a7a001ab8 (diff) | |
download | mobly-snippet-lib-100d1edd8f81a52c6d91e0979e07d144a89708d1.tar.gz |
Fix Naming of `Log.APK_LOG_TAG` (#74)
Diffstat (limited to 'third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java')
-rw-r--r-- | third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java b/third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java index b5b1d9b..fdb4454 100644 --- a/third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java +++ b/third_party/sl4a/src/main/java/com/google/android/mobly/snippet/util/Log.java @@ -23,7 +23,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; public final class Log { - public static volatile String APK_LOG_TAG = null; + public static volatile String apkLogTag = null; private static final String MY_CLASS_NAME = Log.class.getName(); private static final String ANDROID_LOG_CLASS_NAME = android.util.Log.class.getName(); @@ -31,7 +31,7 @@ public final class Log { private Log() {} public static synchronized void initLogTag(Context context) { - if (APK_LOG_TAG != null) { + if (apkLogTag != null) { throw new IllegalStateException("Logger should not be re-initialized"); } String packageName = context.getPackageName(); @@ -44,9 +44,9 @@ public final class Log { "Failed to find ApplicationInfo with package name: " + packageName); } Bundle bundle = appInfo.metaData; - APK_LOG_TAG = bundle.getString("mobly-log-tag"); - if (APK_LOG_TAG == null) { - APK_LOG_TAG = packageName; + apkLogTag = bundle.getString("mobly-log-tag"); + if (apkLogTag == null) { + apkLogTag = packageName; w( "AndroidManifest.xml does not contain metadata field named \"mobly-log-tag\". " + "Using package name for logging instead."); @@ -54,7 +54,7 @@ public final class Log { } private static String getTag() { - String logTag = APK_LOG_TAG; + String logTag = apkLogTag; if (logTag == null) { throw new IllegalStateException("Logging called before initLogTag()"); } |