Using Logcat to log records to a file

Source: Internet
Author: User

In some stages of development, the product has been distributed in a small part, in the event of a problem, we hope that users can send the Logcat log also sent to the programmer for analysis, here is a clever use of the Logcat command line logging method, do not have to write the log records of the code.

Android Shell provides a logcat command, is used to view the system log, this command supports log filtering, logging to a file, and support automatic log file scrolling, control log file size. Therefore, when the system starts, we use runtime to invoke the Logcat command, start a process, you can send us through the Logcat log into the file, the following is the usual parameters:

-v threadtime日志输出的格式,有brief process tag thread raw time threadtime long这么几种可选。-f /sdcard/filepath/ 日志文件输出路径-r51200 单个日志文件最大大小51200kbytes-n 3 最大3个日志文件-s TAG1:V TAG2:D TAG3:W 根据TAG和级别进行过滤

Using Logcat to log records to a file

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.