android-studio - 解释 Android Studio 控制台输出格式以及如何配置以在每一行中显示日期/时间?
问题描述
我是 Flutter 的新手,很高兴知道何时发出了一行跟踪信息。
Flutter 类中的一个简单打印语句,如下所示:
print("hello, console logging");
在控制台/“4.运行”底部选项卡中输出:
I/flutter ( 6731): hello, console logging
三个问题:
- “我/颤动”是什么意思?
- “6731”是什么意思?
- 是否可以配置一些东西来为每一行添加一个时间戳以显示“HH:MM”?
我已经研究了大约一个小时,但找不到任何答案。
解决方案
I/flutter:
这意味着'信息'类型的消息记录。flutter
是日志的标签。更多信息https://developer.android.com/reference/android/util/Log
在 android studio 中,您可以找到Log.i()
接受 TAG 和要记录的消息的方法。例子。Log.i("flutter", "Some message here..");
要打印日志的时间,您可以附加TimeOfDay.now().toString())
您的打印消息,如print("hello, console logging. Time: " + TimeOfDay.now().toString());
推荐阅读
- c++ - 以下代码在 x64 位但不是 x86 构建中崩溃
- angular - ngOnInit scope with this
- java - 没有 websockets 的服务器端 JAVA 的 SockJS 后端解决方案
- r - lapply() to use a function over multiple columns of a dataframe
- html - Is there a way to use {} inside a for-each loop in XSLT?
- angular - Angular - 在其他 div 滑出/滑入时使 div 增长/缩小
- reactjs - Clojurescript 反应扩展不适用于 firefox,适用于 chromium,如何进一步调试?
- spring-boot - Spring Boot security is not working in the simplest case
- python - 为什么 on_raw_reaction_add 从未被 Discord 服务器中的反应激活
- ruby - Ruby:如果数字为负数,如何返回正整数或 0?