mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-27 15:40:03 +08:00
22 lines
496 B
Rust
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)
|
|
} |