Android log output & LogCat, android log output
Android provides its own log output api --> In the android. util. Log class.
There are five common log printing methods in this class. These five methods print logs to LogCat:
1 Log. v (tag, message); // verbose mode, which prints the most detailed Log 2 Log. d (tag, message); // debug-level Log 3 Log. I (tag, message); // info-level Log 4 Log. w (tag, message); // warn-level Log 5 Log. e (tag, message); // error-level logs
The tag and message are two String values respectively. From the android development help document, the tag and message definitions are as follows:
Tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.
Msg The message you wowould like logged.
It can be seen that the tag is used to mark the source of the log message, while the message is the content of this log.
The number of log outputs is counted as: error, warn, info, debug, verbose. The number ranges from small to large.
I changed each method in the previous Activity and added Log. v to each method to record the Log output. The result is as follows.
We can see that the on ** methods that previously called the Log. v function are executed and the Log is printed.
(