本文介绍了记录标签可以是至多23个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于更新1.1 preVIEW 2,我越来越红线下我所有的登录的消息

Since update AS 1.1 Preview 2, I'm getting red lines under all my Log messages

Log.d(TAG, "message");

随着消息:的日志记录标签可以是最多23个字符。

我没更新什么根本的是,除了Android的工作室本身。这是一个错误?

I didn't update anything fundamentally, except Android Studio itself. Is this a bug?

推荐答案

不,这不是一个错误。然而,似乎你的标记的文本长度超过23个字符。

No, it's not a bug. However, it seems your TAG's text length exceed 23 characters.

机器人工作室对1.1 preVIEW 2 最近的变化,

检查传递给记录电话,如果它的值就可以解决,该标签最多为23个字符(所要求的记录API。)

由于在最近的变化很快解释,这是由于 登录 API不允许的标签超过23个字符。

As shortly explained on the recent changes, it's due to how Log API doesn't allow tag that exceeds 23 characters.

从<$c$c>Log.isLoggable(),

...

抛出

抛出:IllegalArgumentException 的被抛出,如果tag.length()> 23

IllegalArgumentException is thrown if the tag.length() > 23.

不过,到现在为止,它会抛出异常的唯一方法。呼叫 Log.d()等会不会把它。

However, up until now, it's the only method that will throw the exception. Calling Log.d(), etc. won't throw it.

您可以通过以下特伦斯的回答禁用皮棉检查。但是,请记住机器人可能会改变这些方法的行为,并可能在未来引发异常。

You can disable the lint checking by following Terence's answer. However, take note that Android may change the behavior of these methods and might throw the exception in the future.

这篇关于记录标签可以是至多23个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 03:46