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

feat: add logger to std err

This commit is contained in:
2021-07-05 00:04:26 +08:00
parent 568a2173d5
commit 80ff02e6b8
3 changed files with 81 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
#[macro_use] extern crate rust_util;
use rust_util::{XResult, SimpleError};
use rust_util::util_msg::set_logger_std_out;
// cargo run --example log
fn main() -> XResult<()> {
@@ -20,6 +21,11 @@ error or ^"##);
println!("{:?}", test_opt_result());
set_logger_std_out(false);
information!("Std err!");
warning!("Std err!");
set_logger_std_out(true);
simple_error!("helloworld {}", 1)
}