eclipse 在 LogCat 中显示 Android 线程 ID

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5494101/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:05:15  来源:igfitidea点击:

Display Android Thread ID in LogCat

androidmultithreadingeclipselogcat

提问by an00b

By default, LogCat on Eclipse displays 5 informational columns:

默认情况下,Eclipse 上的 LogCat 显示 5 个信息列:

Time       Level  pid   tag message 

Is it possible to add a 6th column, displaying thread id?

是否可以添加第 6 列,显示线程 id

采纳答案by an00b

Answering myself: Since 2 weeks have gone by and no concrete suggestion as to how to add a a 6th column for thread id in LogCat has been provided, I can only assume that this isn't possible (currently).

回答我自己:由于 2 周过去了,并且没有提供关于如何在 LogCat 中为线程 id 添加第 6 列的具体建议,我只能假设这是不可能的(当前)。

回答by alexb

Run ADb in the command shell like this:

在命令 shell 中运行 ADb,如下所示:

C:\Temp>adb logcat -v threadtime > t.txt

This will run in parallel to your Eclipse session. Once you done with Eclipse, Ctrl+Cfrom shell and you'll have the log in t.txt. It is not as nice as having it in the Eclipse logcat window but will do the job.

这将与您的 Eclipse 会话并行运行。完成 Eclipse 后,从 shell 输入Ctrl+C并且您将在t.txt 中获得日志。它不像在 Eclipse logcat 窗口中那样好,但可以完成这项工作。

回答by user4148453

adb logcat -v threadtime|tee logcat.log