Android Debug LOG.D () No output

Source: Internet
Author: User

Before I was very fond of using the real machine for debugging, because at that time I think it is easier to debug with the real machine, until I found that my phone does not print LOG.D () debug log, I began to use the simulator frequently. Of course there are two small points: my phone does not support fast start and small computer configuration is relatively low, the simulator too eat memory.

Write a simple application whose code is

 Public class extends appcompatactivity {    @Override    protectedvoid  onCreate (Bundle Savedinstancestate) {        super. OnCreate (savedinstancestate);        Setcontentview (r.layout.activity_main);        LOG.D ("Debug Log", "Hello");        LOG.E ("error log", "Hello");    

It is simple to output a debug log and error log, but the output from the real machine and the emulator is different.

The first thing to use is a real machine.

Its output log has only the error log and the debug log is missing.

Then we use the simulator to debug

It's got all the logs out.

We are very mad when we are debugging an application, but if every log is to be output. Through the Internet to know that some manufacturers are relatively low-level log ban output, so you do not see just the debug log.

Speaking of which, I have a lot of nagging, I recommend the debug log finally use the method of log output, because log is hierarchical, there are filters, which greatly facilitates our capture of the output log, try not to use the system. out. println () and system. err. println ()

Android Debug LOG.D () No output

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.