mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-27 07:30:05 +08:00
chore: example and readme
This commit is contained in:
16
README.md
16
README.md
@@ -3,6 +3,11 @@
|
||||
|
||||
Config `Cargo.toml`:
|
||||
```
|
||||
[dependencies]
|
||||
rust_util = "0.6"
|
||||
|
||||
--OR--
|
||||
|
||||
[dependencies]
|
||||
rust_util = { git = "https://github.com/jht5945/rust_util" }
|
||||
```
|
||||
@@ -27,9 +32,20 @@ Run example:
|
||||
$ cargo run --example log
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
ENV `LOGGER_LEVEL` can be:
|
||||
- `debug` or `*`
|
||||
- `info` or `?` -- default
|
||||
- `ok` or `#`
|
||||
- `warn` or `!`
|
||||
- `error` or `^`
|
||||
|
||||
|
||||
## Update Log
|
||||
|
||||
* Nov 28, 2020 v0.6.19
|
||||
* add util_git
|
||||
* Nov 28, 2020 v0.6.18
|
||||
* add util_term
|
||||
* Jun 21, 2020 v0.3.0
|
||||
|
||||
@@ -2,5 +2,17 @@
|
||||
|
||||
// cargo run --example log
|
||||
fn main() {
|
||||
std::env::set_var("LOGGER_LEVEL", "*");
|
||||
println!(r##"env LOGGER_LEVEL set to:
|
||||
debug or *
|
||||
info or ? -- default
|
||||
ok or #
|
||||
warn or !
|
||||
error or ^"##);
|
||||
|
||||
debugging!("Hello {}", "world!");
|
||||
information!("Hello {}", "world!");
|
||||
success!("Hello {}", "world!");
|
||||
warning!("Hello {}", "world!");
|
||||
failure!("Hello {}", "world!");
|
||||
}
|
||||
Reference in New Issue
Block a user