1
0
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:
2020-11-29 12:05:13 +08:00
parent 6881cebf72
commit 0c38427bcb
2 changed files with 28 additions and 0 deletions

View File

@@ -3,6 +3,11 @@
Config `Cargo.toml`: Config `Cargo.toml`:
``` ```
[dependencies]
rust_util = "0.6"
--OR--
[dependencies] [dependencies]
rust_util = { git = "https://github.com/jht5945/rust_util" } rust_util = { git = "https://github.com/jht5945/rust_util" }
``` ```
@@ -27,9 +32,20 @@ Run example:
$ cargo run --example log $ cargo run --example log
``` ```
<br>
ENV `LOGGER_LEVEL` can be:
- `debug` or `*`
- `info` or `?` -- default
- `ok` or `#`
- `warn` or `!`
- `error` or `^`
## Update Log ## Update Log
* Nov 28, 2020 v0.6.19
* add util_git
* Nov 28, 2020 v0.6.18 * Nov 28, 2020 v0.6.18
* add util_term * add util_term
* Jun 21, 2020 v0.3.0 * Jun 21, 2020 v0.3.0

View File

@@ -2,5 +2,17 @@
// cargo run --example log // cargo run --example log
fn main() { 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!"); information!("Hello {}", "world!");
success!("Hello {}", "world!");
warning!("Hello {}", "world!");
failure!("Hello {}", "world!");
} }