Android 7.0 Log exceeds limit of 23 characters

问题

  Caused by: java.lang.IllegalArgumentException: Log tag "xxxxxx_1.0.2021-08-02-2024.1" exceeds limit of 23 characters
    

Log类说明

public static boolean isLoggable (String tag,     int level)

tag String: The tag to check. This value may be null.
level int: The level to check. Value is ASSERT, ERROR, WARN, INFO, DEBUG, or VERBOSE

IllegalArgumentException is thrown if the tag.length() > 23 for Nougat (7.0) and prior releases (API <= 25), there is no tag limit of concern after this API level.

如果是25之前的版本,tag的长度被限制为23个字符。超出后会报非法参数异常。

Guess you like

Origin blog.csdn.net/chentaishan/article/details/119333746
Recommended