Android Learning Note--log cannot output the workaround and command line to view the log log

Source: Internet
Author: User
Tags log log

I e-mail: [email protected], welcome to exchange discussions.

Welcome reprint, Reproduced please specify the website: http://www.cnblogs.com/JohnTsai/p/3983936.html.

    • Knowledge points

1.log cannot output the workaround

2. Check the log log for Android debugging via command line

    • Log cannot output the workaround

Today debug Android program, found eclipse does not output log log. This makes me very vexed, the program debug log is unable to see. Google has searched for some information. Found that many people on the StackOverflow have also encountered the same problem. Here's a solution.

Http://stackoverflow.com/questions/4228641/logcat-not-displaying-my-log-calls

Http://stackoverflow.com/questions/6090849/why-cant-i-see-my-print-statements-in-logcat

Try the following methods:

1. Go to Ddms, double-click the app you want to debug, or your device

2. Remove all other devices except the one you are debugging.

3. Set the Logcat filter to debug or verbose.

4. Clear the log logs.

5. Restart Eclipse

    • Command line View log log

On the internet to find a lot of ways to solve the log does not output the problem, found that the first time can be output, but the back will not be output. So I thought of the command line adb to view the LOGCAT approach.

Try to find a good result, but the ADB logcat this statement to all the log information output, it is not easy for me to check the log to debug. So Google has some information, organized a bit.

Http://www.herongyang.com/Android/Debug-adb-logcat-Command-Debugging.html

The following are the specific formats for the various usages of the LOGCAT statement:

To better use the "adb logcat" command, let's look at its various options:

"ADB logcat-s" sets the default filter to undocumented (silent)

The "adb logcat-f<filename>" writes the log information output to a file, which by default is the (Stout-standard output) standard output.

"ADB logcat-r <kbytes>" loops every Kbytes output log file, default is 16, requires the-f option

"ADB logcat-n <count>" sets the maximum value of the loop output log file, the default value is 4, and the-r option is required

"ADB logcat-v <format>" sets the output format of log information, which is briefly (brief) output by default

"ADB logcat-c" clears all log messages and then exits

"ADB logcat-d" outputs all log information to the screen and then exits

"ADB logcat-g" prints the size of a specific log buffer and then exits

"ADB logcat-b <buffer>" requires alternate cache ring, "main", "system", "radios", "events", can use parameter-B multiple times, the result is interleaved. The default is-B main-b system

Log Type table identifiers (priority increments):

1.Verbose (V): Verbose (lowest priority)

2.Debug (D): Commissioning

3.Info (I): Message

4.Warn (W): Warning

5.Error (E): Error

6.Fatal (F): significant

7.Silent (S): Non-documented (highest priority)


Android Learning Note--log cannot output the workaround and command line to view the log log

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.