Skip to content

Commit

Permalink
Release v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elvishew committed Apr 6, 2021
1 parent d44b950 commit e58ad51
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Lightweight and pretty, powerful and flexible logger for android and java, can p
Dependency

```groovy
implementation 'com.elvishew:xlog:1.8.0'
implementation 'com.elvishew:xlog:1.9.0'
```

Initialization
Expand Down Expand Up @@ -326,17 +326,23 @@ By default, `FilePrinter` use a `DefaultFlattener`, which just simply concat the

### Auto backup

Every single log file may grow to an unexpected size, a `BackupStrategy` allow you to start a new file at some point, and mark the old file name with `.bak` suffix. There will be at most one `.bak` file in the same time.
Every single log file may grow to an unexpected size, a `BackupStrategy2` allow you to start a new file at some point, and change the old file name with `.bak.n`(n is the backup index) suffix.

```
logs-dir
├──log
└──log.bak
├──log.bak.1
├──log.bak.2
├──log.bak.3
├──...
└──log.bak.n
```

Mostly, you just want to start a new file when the log file reach a specified max-size, so `FileSizeBackupStrategy` is presented for you.
Mostly, you just want to start a new file when the log file reach a specified max-size, so `FileSizeBackupStrategy2` is presented for you.

By default, `NeverBackupStrategy` is used, which will never start a new file.
By default, `FileSizeBackupStrategy(1024*1024)` is used, which will auto backup the log file when it reach a size of 1M. Besides, there will only be one logging file and one backup file in the same time, that means you can save at most only 2M logs.

So, if you want to save more logs, and more backup files, please use `FileSizeBackupStrategy2` instead, this allow you keeping multiple backup files in the same time.

### Auto clean

Expand Down Expand Up @@ -444,7 +450,7 @@ grep -rl "android.util.Log" <your-source-directory> | xargs sed -i "" "s/android
## TODO

* [ ] Third-party libs log interception
* [ ] Support multiple backup files
* [*] Support multiple backup files

## [Issues](https://github.com/elvishew/xLog/issues)

Expand All @@ -460,7 +466,7 @@ Thanks to [Serge Zaitsev](https://github.com/zserge)'s [log](https://github.com/
## License

<pre>
Copyright 2020 Elvis Hew
Copyright 2015-2021 Elvis Hew

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
依赖

```groovy
implementation 'com.elvishew:xlog:1.8.0'
implementation 'com.elvishew:xlog:1.9.0'
```

初始化
Expand Down
4 changes: 2 additions & 2 deletions library/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ POM_ARTIFACT_ID=xlog
POM_PACKAGING=jar
POM_DESCRIPTION=Android logger, pretty, powerful and flexible, logging to file and everywhere

VERSION_NAME=1.8.0-SNAPSHOT
VERSION_CODE=15
VERSION_NAME=1.9.0
VERSION_CODE=16

0 comments on commit e58ad51

Please sign in to comment.