1. log on.
CodeAs follows:
Package COM. example. hello; import android. OS. bundle; import android. app. activity; import android. util. log; import android. view. menu; public class mainactivity extends activity {@ override protected void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. activity_main); log. V ("Fighting", "Zhang Zetian is a JavaProgramMember goddess 1 "); log. D ("Fighting", "Zhang Zetian is Allen's Goddess 2"); log. I ("Fighting", "We all like Zhang Zetian 3"); log. W ("Fighting", "Zhang Zetian ~~~~~ 4 "); log. V (" Fighting "," Come on !!! 5 ") ;}@ override public Boolean oncreateoptionsmenu (menu) {// inflate the menu; this adds items to the action bar if it is present. getmenuinflater (). inflate (R. menu. main, menu); Return true ;}}
2. View logs
1) logcat
Click logcat. The following page is displayed in this perspective:
2) (create a LOG filter, which is mainly used to find what you need among many logs)
Click the Green Cross above to see the following interface:
At this time, we can easily find the log we need .. In fact, 1) the graph used is the log obtained after the filter is used.