Introduction and use of Logcat in Android
Last Update:2015-05-21
Source: Internet
Author: User
<span id="Label3"></p> <p class="MsoNormal"><p class="MsoNormal"><span style="background:rgb(217,217,217); font-family:宋体; font-size:12pt">Logcat <span style="font-family:宋体">logs are ranked from lowest to highest levels</span></span><span style="background:rgb(217,217,217); font-family:宋体; font-size:12pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="background:rgb(217,217,217); font-family:宋体; font-size:10.5pt">Verbose <span style="font-family:宋体">: redundancy, lowest level. Black</span></span><span style="background:rgb(217,217,217); font-family:宋体; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="msonormal" style="text-indent:21pt"><span style="background:rgb (217,217,217); font-family: Song body; font-size : 10.5pt ">debug<span style=" font-family: Arial ">: debugging information </span> </span> <span style=" Background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> </span> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> </span> Span style= "background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> Blue </span> <span style="background:rgb (217,217,217); font-family: Song body; font-size:10.5pt"> </span> </p></p><p class="MsoNormal" style="text-indent:21pt"><p class="msonormal" style="text-indent:21pt"><span style="background:rgb (217,217,217); font-family: Song body; font-size : 10.5pt ">info<span style=" font-family: Arial ">: general information </span> </span> <span style=" Background:rgb ( 217,217,217); Font-family: Song body; font-size:10.5pt "> </span> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> </span> Span style= "background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> Green </span> <span style="background:rgb (217,217,217); font-family: Song body; font-size:10.5pt"> </span> </p></p><p class="MsoNormal" style="text-indent:21pt"><p class="msonormal" style="text-indent:21pt"><span style="background:rgb (217,217,217); font-family: Song body; font-size : 10.5pt ">warning <span style=" font-family: Arial ">: warning </span> </span> <span style=" Background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> </span> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> </span> Span style= "background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> </span> Span style= "background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> Orange <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt " < span></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="msonormal" style="text-indent:21pt"><span style="background:rgb (217,217,217); font-family: Song body; font-size : 10.5pt ">error<span style=" font-family: Arial ">: error </span> </span> <span style=" Background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> </span> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> </span> Span style= "background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt "> </span> Span style= "background:rgb (217,217,217); Font-family: Song body; font-size:10.5pt "> Red <span style=" background:rgb (217,217,217); font-family: Song body; font-size:10.5pt " < span></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="background:rgb(217,217,217); font-family:宋体; font-size:10.5pt">Assert<span style="font-family:宋体">: Highest assertion level</span></span><span style="background:rgb(217,217,217); font-family:宋体; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:‘Times New Roman‘; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:宋体; font-size:10.5pt">debugging information is generally passed</span> <span style="font-family:宋体; font-size:10.5pt">Debug <span style="font-family:宋体">or</span> <span style="font-family:Times New Roman">info</span> <span style="font-family:宋体">print</span> </span><span style="font-family:宋体; font-size:10.5pt"></span></p></p> <table class="MsoNormalTable" style="width:416.8pt; margin-left:4.65pt; border-collapse:collapse"> <tbody> <tr> <td width="555" valign="center" style="padding:0.75pt; border:0.75pt solid rgb(187,187,187); width:416.8pt"><p class="MsoNormal" style="text-align:left"><p class="MsoNormal" style="text-align:left"><span style="background:rgb(255,255,0); color:rgb(0,0,0); font-family:宋体; font-size:10pt">The System.out and System.err output information is also displayed in the logcat,</span><span style="background:rgb(255,255,0); color:rgb(0,0,0); font-family:‘Times New Roman‘; font-size:10pt"></span></p></p><p class="MsoNormal" style="text-align:left"><p class="MsoNormal" style="text-align:left"><span style="background:rgb(255,255,0); color:rgb(0,0,0); font-family:宋体; font-size:10pt">Note</span> <span style="background:rgb(255,255,0); color:rgb(0,147,0); font-family:宋体; font-size:10pt">System.out Output information is info level</span> <span style="background:rgb(255,255,0); color:rgb(0,0,0); font-family:宋体; font-size:10pt">,</span> <span style="background:rgb(255,255,0); color:rgb(255,104,32); font-family:宋体; font-size:10pt">System.err is warn level</span><span style="background:rgb(255,255,0); color:rgb(0,0,0); font-family:‘Times New Roman‘; font-size:10pt"></span></p></p></td> </tr> </tbody> </table><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:宋体; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:‘Times New Roman‘; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:‘Times New Roman‘; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:宋体; font-size:10.5pt">Android <span style="font-family:宋体">has its own way of debugging: you can define your own</span> <span style="font-family:Times New Roman">tag</span> <span style="font-family:宋体">and level</span></span><span style="font-family:宋体; font-size:10.5pt"></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="background:rgb(255,255,255); color:rgb(63,127,95); font-family:宋体; font-size:12pt">Android <span style="font-family:宋体">offers a dedicated way to print output</span></span><span style="background:rgb(255,255,255); color:rgb(63,127,95); font-family:宋体; font-size:12pt"></span></p></p><p class="MsoNormal" style="text-align:left"><p class="MsoNormal" style="text-align:left"><span style="color:rgb(63,127,95); font-family:宋体; font-size:12pt">// <span style="font-family:宋体">Print error level information</span> </span> <span style="color:rgb(63,127,95); font-family:宋体; font-size:12pt"> </span> <span style="background:rgb(255,255,0); color:rgb(63,127,95); font-family:宋体; font-size:12pt">Tag <span style="font-family:宋体">is usually the current class name</span> </span><span style="font-family:宋体; font-size:12pt"></span></p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (255,0,0); font-family: Song body; font-size:12pt "> Log </span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt" . < span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt; font-style:italic">e </span> <span style="color: RGB (0,0,0); Font-family: Song body; font-size:12pt "> (</span> <span style=" color:rgb (42,0,255); font-family: arial; font-size:12pt " " aa "< span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " ", < span> <span style="color:rgb (42,0,255); font-family: arial; font-size:12pt"> "dsdfsf" </span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " "); < span> <span style="font-family: Song body; font-size:12pt"> </span> </span></span></span></span></p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (63,127,95); font-family: Song body; font-size:12pt "> //<span style="font-family: arial"> Print warning Level information </span> </span> <span style="font-family: arial; font-size:12pt"> </span> </p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (255,0,0); font-family: Song body; font-size:12pt "> Log </span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt" . < span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt; font-style:italic">w </span> <span style="color: RGB (0,0,0); Font-family: Song body; font-size:12pt "> (</span> <span style=" color:rgb (42,0,255); font-family: arial; font-size:12pt " " aa "< span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " ", < span> <span style="color:rgb (42,0,255); font-family: arial; font-size:12pt"> "dsdfsf" </span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " "); < span> <span style="font-family: Song body; font-size:12pt"> </span> </span></span></span></span></p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (63,127,95); font-family: Song body; font-size:12pt "> //<span style="font-family: arial"> print information-level information </span> </span> <span style="font-family: arial; font-size:12pt"> </span> </p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (255,0,0); font-family: Song body; font-size:12pt "> Log </span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt" . < span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt; font-style:italic">i </span> <span style="color: RGB (0,0,0); Font-family: Song body; font-size:12pt "> (</span> <span style=" color:rgb (42,0,255); font-family: arial; font-size:12pt " " aa "< span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " ", < span> <span style="color:rgb (42,0,255); font-family: arial; font-size:12pt"> "dsdfsf" </span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " "); < span> <span style="font-family: Song body; font-size:12pt"> </span> </span></span></span></span></p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (63,127,95); font-family: Song body; font-size:12pt "> //<span style="font-family: song body"> print debug level information </span> </span> <span style="font-family:" arial; font-size:12pt "> </span> </p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (255,0,0); font-family: Song body; font-size:12pt "> Log </span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt" . < span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt; font-style:italic">d </span> <span style="color: RGB (0,0,0); Font-family: Song body; font-size:12pt "> (</span> <span style=" color:rgb (42,0,255); font-family: arial; font-size:12pt " " aa "< span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " ", < span> <span style="color:rgb (42,0,255); font-family: arial; font-size:12pt"> "dsdfsf" </span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " "); < span> <span style="font-family: Song body; font-size:12pt"> </span> </span></span></span></span></p></p><p class="MsoNormal" style="text-align:left"><p class="msonormal" style="text-align:left"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (0,0,0); Font-family: Song body; font-size:12pt "> <span style=" color:rgb (63,127,95); font-family: Song body; font-size:12pt "> // <span style="font-family: arial"> Print redundancy level information </span> </span> <span style="font-family: Song body; font-size:12pt"> </span> </p></p><p class="MsoNormal" style="text-indent:21pt"><p class="msonormal" style="text-indent:21pt"><span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt"> </span> Span style= "color:rgb (255,0,0); Font-family: Song body; font-size:12pt ">log <span style=" color:rgb (0,0,0); font-family: Song body; font-size:12pt " . < span> <span style="color:rgb (0,0,0); font-family: Song body; font-size:12pt; font-style:italic">v </span> <span style="color: RGB (0,0,0); Font-family: Song body; font-size:12pt "> (</span> <span style=" color:rgb (42,0,255); font-family: arial; font-size:12pt " " aa "< span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " ", < span> <span style="color:rgb (42,0,255); font-family: arial; font-size:12pt"> "dsdfsf" </span> <span style="color:rgb (0,0,0); Font-family: Song body; font-size:12pt " "); < span> <span style="background:rgb (255,255,255); color:rgb (63,127,95); font-family: Song body; font-size:12pt"> </span> </span></span></span></span></p></p><p class="MsoNormal" style="text-indent:21pt"><p class="MsoNormal" style="text-indent:21pt"><span style="font-family:宋体; font-size:10.5pt">After running an application with <span style="font-family:Times New Roman">log</span> <span style="font-family:宋体">information, The system creates a</span> filter name that contains all the <span style="font-family:Times New Roman">log</span> information for the application <span style="font-family:宋体">as the Application's identification package Name. But there</span> are <span style="font-family:Times New Roman">bugs</span><span style="font-family:宋体">, and sometimes it doesn't filter out some Information. </span></span><span style="font-family:宋体; font-size:10.5pt"></span></p></p><p><p>Introduction and use of Logcat in Android</p></p></span>