GithubHelp home page GithubHelp logo

xlog's Introduction

##XLOG简介

  • 自动保存LOG
  • 过期删除LOG,控制LOG存储大小
  • 自定义Crash操作

Download

Gradle构建:

compile 'com.sum.xlog:xlog:1.1.4'

初始化:

XLogConfiguration.Builder builder = new XLogConfiguration.Builder(MyApplication.this)
				.setConsoleLogLevel(LogLevel.D) //Logger输出最低级别
				.setFileLogLevel(LogLevel.D) //保存至文件最低级别
				.setCrashHandlerOpen(true) //开启异常捕获
				.setOriginalHandler(Thread.getDefaultUncaughtExceptionHandler()) //第三方统计
				.setOnCrashInfoListener(new OnCrashInfoListener() {
					@Override
					public void onUpdateCrashInfo(File file) {
						// 可以根据自己的需求启动另一个进程实现上传文件至服务器,
						// Note: 不能直接做耗时操作,影响后续UncaughtExceptionHandler
						Log.d("onUpdateCrashInfo","onUpdateCrashInfo");
					}
				}) //Crash回调
				.setFileLogRetentionPeriod(7); //过期删除

XLog使用方法:

XLog.startMethod();
XLog.d("=== XXX ===");
XLog.d("=== %s,%s ===", "XXX", "XXX");
XLog.endMethod();

FileUtil.getTodayLogFile() //获取当天LOG日志文件
FileUtil.getXLogDirFile() //获取LOG日志文件夹

混淆

-keepattributes SourceFile,LineNumberTable
-keep class com.sum.xlog.print.XLogPrinterImpl {*;}

Email: [email protected]

xlog's People

Contributors

qiu800820 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.