Open Source Address: Https://github.com/orhanobut/logger
Reference
1.http://www.open-open.com/lib/view/open1427166371418.html
2.http://www.jianshu.com/p/21902079e88f
The Log program provides:
- Threading Information Thread Information
- Class Information Classes Information
- Methods Information Method Information
- Beautiful printed JSON content Pretty-print for JSON contents
- Clean output
- Jump to Source feature
Gradle
Compile ' com.orhanobut:logger:1.3 '
The current log system
LOG.D (TAG, "Hello");
Logger
LOGGER.D ("Hello");
Usage
LOGGER.D ("Hello"); LOGGER.E ("Hello"); LOGGER.W ("Hello"); LOGGER.V ("Hello"); LOGGER.WTF ("Hello"); Logger.json (json_content);
As follows:
The default print tag is Prettylogger, this is the logger default tag, if you want to modify can:
Modify the print Tag Value logger.init ("mainactivity"); String userName = "Jerry"; LOGGER.I (UserName);
Some small partners think, I do not want to always use a tag, that is not to write a lot of logger.init (tag) to modify, we look at the method called Init, the author's meaning is estimated to use only once.
Can be set to:
All of them is optional.
Logger . Init (Your_tag) //default Tag:prettylogger or use just init () . Setmethodcount (3) //default 2< C5/>.hidethreadinfo () //default it is shown setloglevel (loglevel.none); Default:LogLevel.FULL
Android Open source Log Library Logger