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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user