Fixed: Do not use colon character ":" in log tag since it is invalid and breaks logcat command filterspecs argument

This commit is contained in:
agnostic-apollo
2021-10-31 07:32:24 +05:00
parent 0a3efc537d
commit 1b794b3518

View File

@@ -450,11 +450,17 @@ public class Logger {
return CURRENT_LOG_LEVEL;
}
/** The colon character ":" must not exist inside the tag, otherwise the `logcat` command
* filterspecs arguments `<tag>[:priority]` will not work and will throw `Invalid filter expression`
* error.
* https://cs.android.com/android/platform/superproject/+/android-12.0.0_r4:system/logging/liblog/logprint.cpp;l=363
* https://cs.android.com/android/platform/superproject/+/android-12.0.0_r4:system/logging/logcat/logcat.cpp;l=884
* */
public static String getFullTag(String tag) {
if (DEFAULT_LOG_TAG.equals(tag))
return tag;
else
return DEFAULT_LOG_TAG + ":" + tag;
return DEFAULT_LOG_TAG + "." + tag;
}
public static boolean isLogLevelValid(Integer logLevel) {