1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 07:30:05 +08:00
Files
rust_util/examples/log.rs
2021-01-01 18:58:04 +08:00

22 lines
496 B
Rust

#[macro_use] extern crate rust_util;
use rust_util::XResult;
// cargo run --example log
fn main() -> XResult<()> {
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!");
simple_error!("helloworld {}", 1)
}