diff --git a/switch-desktop/src/main.rs b/switch-desktop/src/main.rs index 4fa2d65..3b66ab5 100644 --- a/switch-desktop/src/main.rs +++ b/switch-desktop/src/main.rs @@ -91,6 +91,7 @@ pub struct StartArgs { off_command_server: bool, /// 记录日志,输出在 home/.switch 目录下,长时间使用时不建议开启 /// Output the log in the "home/.switch" directory + #[arg(long)] log: bool, } diff --git a/switch/Cargo.toml b/switch/Cargo.toml index 1d760ef..9d70479 100644 --- a/switch/Cargo.toml +++ b/switch/Cargo.toml @@ -26,7 +26,7 @@ chrono = "0.4.23" #lazy_static = "1.4.0" #moka = "0.9.6" protobuf = "3.2.0" -local-ip-address = "0.4.9" +#local-ip-address = "0.4.9" #mio = {version = "0.8.6",features = ["os-poll", "net"]} #tokio = { version = "1.24.1", features = ["full"] } diff --git a/switch/src/tun_device/unix.rs b/switch/src/tun_device/unix.rs index 1d66659..28e5e79 100644 --- a/switch/src/tun_device/unix.rs +++ b/switch/src/tun_device/unix.rs @@ -68,7 +68,9 @@ impl TunWriter { return Err(io::Error::new(io::ErrorKind::Other, format!("{:?}", e))); } #[cfg(target_os = "macos")] - crate::tun_device::mac::config_ip(dev.name(), address, netmask, gateway); + if let Err(e) = crate::tun_device::mac::config_ip(dev.name(), address, netmask, gateway){ + log::error!("{}",e); + } return Ok(()); } }