Coder Social home page Coder Social logo

logutils's Introduction

LogUtils

More convenient and easy to use android Log manager

Features

  • 支持直接打印数据集合,如List、Set、Map、数组等
  • 全局配置log输出
  • 不需要设置tag
  • 准确显示调用方法、行,快速定位所在文件位置.

screenshot

效果图

截图

日志说明

截图

打印数据列表

截图

打印数组

截图

Simple

// 输出字符串
LogUtils.d("12345");

// 输出参数
LogUtils.d("12%s3%d45", "a", 0);

// 输出异常
LogUtils.d(new NullPointerException("12345"));

// 输出对象
Person person = new Person();
person.setAge(11);
person.setName("pengwei");
person.setScore(37.5f);
LogUtils.d(person);

// 对象为空
LogUtils.d(null);

// 输出json(json默认debug打印)
String json = "{'a':'b','c':{'aa':234,'dd':{'az':12}}}";
LogUtils.json(json);

// 打印数据集合
List<Person> list1 = new ArrayList<>();
for(int i = 0; i < 4; i++){
    list1.add(person);
}
LogUtils.d(list1);

// 打印数组
double[][] doubles = {{1.2, 1.6, 1.7, 30, 33},
                {1.2, 1.6, 1.7, 30, 33},
                {1.2, 1.6, 1.7, 30, 33},
                {1.2, 1.6, 1.7, 30, 33}};
LogUtils.d(doubles);

// 其他用法
LogUtils.v("12345");
LogUtils.i("12345");
LogUtils.w("12345");
LogUtils.e("12345");
LogUtils.wtf("12345");

options

// 配置日志是否输出(默认true)
LogUtils.configAllowLog = false;

// 配置日志前缀
LogUtils.configTagPrefix = "abc-";

Usage

Gradle

compile 'com.apkfuns.logutils:library:1.0.4'

Maven

<dependency>
    <groupId>com.apkfuns.logutils</groupId>
    <artifactId>library</artifactId>
    <version>1.0.4</version>
</dependency>

Jar

click here to download sources.jar

History

  • 1.0.0 (2015/07/13)
    • 打印对象,字符串,异常,且显示文件行数
  • 1.0.1 (2015/07/22)
    • 打印json字符串
  • 1.0.2 (2015/07/24)
    • 支持打印List、Se等数据集合
  • 1.0.3 (2015/07/24)
    • 支持打印Map集合
  • 1.0.4 (2015/07/25)
    • 支持打印数组(暂仅支持一维、二维数组)

About

Thanks

thanks to wyouflf/xUtilsorhanobut/logger

License

Copyright 2015 Orhan Obut

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

logutils's People

Contributors

pengwei1024 avatar

Watchers

melbshark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.