diff --git a/src/log.rs b/src/log.rs index 9c8fb76..c70ae1d 100644 --- a/src/log.rs +++ b/src/log.rs @@ -1,3 +1,5 @@ +use tracing::warn; + pub fn init_log_with_cli() { // 命令行参数 // --warn @@ -5,7 +7,11 @@ pub fn init_log_with_cli() { // --trace // 从低级开始判断 - tracing_subscriber::fmt() + let trace = tracing_subscriber::fmt() .with_max_level(tracing::Level::DEBUG) - .init(); + .with_line_number(true) + .try_init(); + if trace.is_err() { + warn!("init log with trace failed: {:?}", trace.err()); + } } diff --git a/tests/socket-test/Cargo.toml b/tests/socket-test/Cargo.toml index e9dc3b3..7deed9e 100644 --- a/tests/socket-test/Cargo.toml +++ b/tests/socket-test/Cargo.toml @@ -15,6 +15,3 @@ toml = "0.8.8" tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["time"] } - -[patch.crates-io] -rust_socketio = { git = "https://github.com/shenjackyuanjie/rust-socketio.git", branch = "mult_payload" }