这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 1b794b3

Browse files
Fixed: Do not use colon character ":" in log tag since it is invalid and breaks logcat command filterspecs argument
1 parent 0a3efc5 commit 1b794b3

File tree

1 file changed

+7
-1
lines changed
  • termux-shared/src/main/java/com/termux/shared/logger

1 file changed

+7
-1
lines changed

termux-shared/src/main/java/com/termux/shared/logger/Logger.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,17 @@ public static int setLogLevel(Context context, int logLevel) {
450450
return CURRENT_LOG_LEVEL;
451451
}
452452

453+
/** The colon character ":" must not exist inside the tag, otherwise the `logcat` command
454+
* filterspecs arguments `<tag>[:priority]` will not work and will throw `Invalid filter expression`
455+
* error.
456+
* https://cs.android.com/android/platform/superproject/+/android-12.0.0_r4:system/logging/liblog/logprint.cpp;l=363
457+
* https://cs.android.com/android/platform/superproject/+/android-12.0.0_r4:system/logging/logcat/logcat.cpp;l=884
458+
* */
453459
public static String getFullTag(String tag) {
454460
if (DEFAULT_LOG_TAG.equals(tag))
455461
return tag;
456462
else
457-
return DEFAULT_LOG_TAG + ":" + tag;
463+
return DEFAULT_LOG_TAG + "." + tag;
458464
}
459465

460466
public static boolean isLogLevelValid(Integer logLevel) {

0 commit comments

Comments
 (0)