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

feat: v0.5.48

This commit is contained in:
2025-07-26 08:52:31 +08:00
parent c1ef4c4b53
commit af4b91d4e9
3 changed files with 28 additions and 2 deletions

View File

@@ -1,10 +1,22 @@
#[macro_use] extern crate rust_util;
use std::sync::mpsc::channel;
use std::thread;
use rust_util::{XResult, SimpleError};
use rust_util::util_msg::set_logger_std_out;
use rust_util::util_msg::{set_logger_sender, set_logger_std_out};
// cargo run --example log
fn main() -> XResult<()> {
let (sender, receiver) = channel::<String>();
set_logger_sender(sender);
let _t = thread::spawn(move || {
loop {
let msg = receiver.recv();
println!("[RECV]: {:?}", msg)
}
});
std::env::set_var("LOGGER_LEVEL", "*");
println!(r##"env LOGGER_LEVEL set to:
debug or *