Skip to content

Commit a96187d

Browse files
committed
Update readme docs
1 parent 1fc4a7a commit a96187d

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "android_logger"
3-
version = "0.8.1"
3+
version = "0.8.2"
44
authors = ["The android_logger Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,43 @@ this library:
1515
android_logger = "0.8.1"
1616
```
1717

18-
Example of initialization on activity creation, with log filters:
18+
Example of initialization on activity creation, with log configuration:
1919

2020
```rust
2121
#[macro_use] extern crate log;
2222
extern crate android_logger;
2323

2424
use log::Level;
25-
use android_logger::Filter;
25+
use android_logger::{Config,FilterBuilder};
2626

2727
fn native_activity_create() {
2828
android_logger::init_once(
29-
Filter::default()
29+
Config::default()
3030
.with_min_level(Level::Trace) // limit log level
31-
.with_allowed_module_path("hello::crate"), // limit messages to specific crate
32-
Some("mytag") // logs will show under mytag tag. If `None`, the crate name will be used
31+
.with_tag("mytag") // logs will show under mytag tag
32+
.with_filter( // configure messages for specific crate
33+
FilterBuilder::new()
34+
.parse("debug,hello::crate=error")
35+
.build())
3336
);
3437

3538
trace!("this is a verbose {}", "message");
3639
error!("this is printed by default");
3740
}
3841
```
3942

40-
To allow all logs, use the default filter with min level Trace:
43+
To allow all logs, use the default configuration with min level Trace:
4144

4245
```rust
4346
#[macro_use] extern crate log;
4447
extern crate android_logger;
4548

4649
use log::Level;
47-
use android_logger::Filter;
50+
use android_logger::Config;
4851

4952
fn native_activity_create() {
50-
android_logger::init_once(Filter::default().with_min_level(Level::Trace), None);
53+
android_logger::init_once(
54+
Config::default().with_min_level(Level::Trace));
5155
}
5256
```
5357

0 commit comments

Comments
 (0)