简体   繁体   English

在Logcat日志中使用表情符号可以吗?

[英]Is it okay to use emojis in Logcat logs?

I am using emojis in log cat messages in order to make the logs easier on the eye. 我在日志猫消息中使用了表情符号,以使日志更容易被看到。 So far it works fine, but I wonder if I'll hit any character compatibility issues on older Android devices. 到目前为止,它可以正常工作,但是我想知道我是否会在较旧的Android设备上遇到任何字符兼容性问题。 My app's minimumSdkVersion is 16. 我的应用的最小SdkVersion为16。

Examples: 例子:

companion object {
    private const val TAG = "\uD83D\uDD36SomeClass"
}

...    

Log.d(TAG, "⏰ Something happened!")

Is there anything I should be worried about? 我有什么需要担心的吗? Are there any reasons against doing this? 有什么理由反对这样做吗?

Not sure about your emojis in Logcat but I think that if you want to make your life easier use the TAG that inside your Log.d . 不确定Logcat中的表情符号,但我认为,如果您想使生活更轻松,请使用Log.d内部的TAG。

For example, here is a log with a custom TAG: 例如,这是带有自定义TAG的日志:

   Log.d("myTag","something to show");

After you run your app all you need to do is to search the same tag name within your logcat, like this: 运行应用程序后,您需要做的就是在logcat中搜索相同的标签名称,如下所示:

在此处输入图片说明


Another thing that you should think about that if you want to search for a specific log would it be comfortable to search the logcat using emojis? 您还应该考虑的另一件事是,如果要搜索特定的日志,使用表情符号搜索logcat会很舒服吗?

In my opinion, simply searching your tag name to find your log makes thing super easy. 我认为,只需搜索标签名称以查找日志,就可以轻松完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM