Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tohodog authored Dec 8, 2020
1 parent 0e9df8b commit 6100c98
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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日志
Expand All @@ -33,7 +33,7 @@ allprojects {
}
dependencies {
implementation 'com.github.tohodog:QLog:1.0'
implementation 'com.github.tohodog:QLog:1.1'
}
```

Expand All @@ -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
Expand All @@ -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

0 comments on commit 6100c98

Please sign in to comment.