Android Log Output-logger

Source: Internet
Author: User

In the Android development process, the log printing is essential, below to recommend a github on the open source log framework-logger

Advantage
    • Accurate location and related information display of the thread, class and method of the log
    • Beautiful print output format
    • Supports print output in JSON and XML format
    • Support for jumping from print to corresponding code
    • Multiple log output levels (. d. e. W. V)
Add a reference to Android Studio-gradle
‘com.orhanobut:logger:1.11‘
Eclipse

This

Example of simple code output
Logger.d("hello");Logger.d("hello %s %d""world"5);   // 支持String.format
More sample output
Logger.d("hello");Logger.e"message");Logger.json(JSON_CONTENT);
Information configuration
        Logger             .init(YOUR_TAG)               // 日志显示的Tag值             .setMethodCount(3)            // 输出方法数 默认值为2             .hideThreadInfo()             // 隐藏线程信息 默认显示             .setLogLevel(LogLevel.NONE // 设置Log级别 默认为LogLevel.FULL             .setMethodOffset(2)           // 输出方法层级 默认值为0

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Log Output-logger

Related Article

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.