Giter Site home page Giter Site logo

logs's Introduction

Logs

简介

基于android.util.Log做了一层封装,使得如下:

  1. 针对json格式化输出
  2. 设置APP的全局Log标签
  3. 输出Logs代码调用处:所在线程、所在文件、所在方法、所在行数
  4. 对于超限字符串自动分段输出,避免log信息丢失

json效果输出

╔═══════════════════════════════════════════════════════════════════════════════════════
║ [ main: (MainActivity.kt:25) testLog ]
║ {
║     "employees": [
║         {
║             "firstName": "Bill",
║             "lastName": "Gates"
║         },
║         {
║             "firstName": "George",
║             "lastName": "Bush"
║         },
║         {
║             "firstName": "Thomas",
║             "lastName": "Carter"
║         }
║     ]
║ }
╚═══════════════════════════════════════════════════════════════════════════════════════

使用

程序开始处调用初始化开关与全局TAG即可

Logs.init(Logs.DEBUG, "log-demo")

配置

gradle

implementation "com.sqq.xiaqu:logs:1.1.0"

maven

<dependency>
  <groupId>com.sqq.xiaqu</groupId>
  <artifactId>logs</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

更新日志

  • v1.0.1 log开关的控制方式,更改为等级控制,使得release包也可以输出一些关键信息。
  • v1.0.2 添加默认全局tag,避免未调用init时,因tag为空字符串,导致log未被输出
  • v1.0.3 修改json中的url输出等级
  • v1.1.0 Java静态封装,方便Java代码中调用,避免kt的伴生对象

logs's People

Contributors

xiaqu-stone avatar

Stargazers

李小义 avatar

Watchers

James Cloos avatar  avatar

Forkers

autorizadabr

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.