Yeluzi playing Android (2) using log to print information

Tip: After the article is written, the table of contents can be automatically generated. How to generate it can refer to the help document on the right

Article Directory


foreword

This series is mainly used to record the relevant content of learning Android. This article learns how Android prints log information.


1. log function

The log function in Android has five methods, as shown in the figure below, the log function has two parameters, tag: mainly used to filter the print information, generally use the class name of the class to be printed; msg: the specific content of the print information

2. Function implementation

Since all methods of the Log function need to pass in a tag parameter, declare a TAG constant outside the onCreate method, as shown in the figure below

The print results are as follows, and the red mark is the printed error information


Summarize

This article mainly learns five methods of log printing logs, and how to view and print information on Android

Guess you like

Origin blog.csdn.net/m0_60030015/article/details/125967923