debugging with logcat

自闭症网瘾萝莉.ら 提交于 2019-12-12 04:23:08

问题


Once having gotten used to logcat (on MAC) it is quite OK.

However there are two issues I would like to know if there is a way to improve them.

a) how many lines are stored in logcat? is there a way to increase this? sometimes I would like to log several thousand lines, but lines get deleted by some kind of logic which I yet need to understand.

b) searching is logcat is OK typing the search text in the search line, however it's more of a filter than a search. If I now want to start looking at the subsequent line lets say from the first occurance of the found text, one can't, since the cursor or line gets lost as soon as the filter is removed.

The only way now to actually go to the line is to look at the time stamp and revisit the complete log content manually searching for the line that the filter has shown before - not forgetting to press the "pause" btn so that scrolling back does not get interrupted by some system messages

I hope I could explain this well enough to be understandable :-)


回答1:


As far as i understood, you talking about logcat window in Eclipse.

  1. You can increase count of lines in this window by modifing Window->Preferences->Android->LogCat->Maximum number of logcat messages to buffer value.
  2. You can open Terminal window and redirect logcat in file:

    adb logcat > $HOME/logcat.xt

than you can view this file in another Terminal window, search this file with your favorite text editor, filter it with grep etc.



来源:https://stackoverflow.com/questions/10212805/debugging-with-logcat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!