Android Open source Log Library Logger

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.