From 6100c980593cd1115e1ef2c3d561eb220cc90f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E5=B0=8F=E8=B7=AF?= Date: Tue, 8 Dec 2020 18:08:32 +0800 Subject: [PATCH] Update README.md --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1cc809a..c4b14e0 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Android Log Persistence Lightweight Framework 安卓日志持久化轻量级框 * 非阻塞,线程安全,SimpleDateFormat优化 ## DEMO ``` - QLog.init(getApplication()); //初始化,默认路径->/Android/data/包名/files/DCIM/QLog + QLog.init(getApplication()); //初始化,默认路径->/Android/data/包名/files/DCIM/QLog - QLog.i("info日志"); //默认写入-> 2020-10-20_QLog.txt - QLog.e("login", "error日志"); //写入-> 2020-10-20_login.txt + QLog.i("info日志"); //默认写入-> 2020-10-20_QLog.txt + QLog.e("login", "error日志"); //写入-> 2020-10-20_login.txt 2020-10-20 08:27:00.360 INFO [main] info日志 2020-10-20 08:27:00.360 ERROR [Thread-2] error日志 @@ -33,7 +33,7 @@ allprojects { } dependencies { - implementation 'com.github.tohodog:QLog:1.0' + implementation 'com.github.tohodog:QLog:1.1' } ``` @@ -46,9 +46,15 @@ QLog.init(QLogConfig.Build(getApplication()) .day(30)//日志保留30天,默认无限制 .methodCount(1)//打印调用方法名 .debug(true)//true会输出控制台,上线可关掉 + .logFormat(new LogFormat() {//格式化日记 + @Override + public String format(Level level, String time, String log, String stact) { + return level + " " + time + " " + log + " --" + stact; + } + }) .build()); -QLog.flush();//如果要杀死App,需调用写入缓存 +QLog.flush();//如果要退出(杀死)App,需调用写入缓存 ``` ## Other @@ -58,7 +64,7 @@ QLog.flush();//如果要杀死App,需调用写入缓存 [starsvg]: https://img.shields.io/github/stars/tohodog/QLog.svg?style=social&label=Stars [star]: https://github.com/tohodog/QLog -[qlogsvg]: https://img.shields.io/badge/Qlog-1.0-green.svg +[qlogsvg]: https://img.shields.io/badge/Qlog-1.1-green.svg [licensesvg]: https://img.shields.io/badge/License-Apache--2.0-red.svg [license]: https://raw.githubusercontent.com/tohodog/QLog/master/LICENSE