1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 15:40:03 +08:00

feat: add simple_error

This commit is contained in:
2021-01-01 18:58:04 +08:00
parent 1a3c8cbeb4
commit f0bd9a719a
4 changed files with 54 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
#[macro_use] extern crate rust_util;
use rust_util::XResult;
// cargo run --example log
fn main() {
fn main() -> XResult<()> {
std::env::set_var("LOGGER_LEVEL", "*");
println!(r##"env LOGGER_LEVEL set to:
debug or *
@@ -15,4 +17,6 @@ error or ^"##);
success!("Hello {}", "world!");
warning!("Hello {}", "world!");
failure!("Hello {}", "world!");
simple_error!("helloworld {}", 1)
}