mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-20 13:59:10 +00:00
print error info
This commit is contained in:
parent
b11e49b455
commit
cfbc5fabb1
1 changed files with 8 additions and 1 deletions
|
@ -10,7 +10,14 @@ async fn main() -> Result<(), BoxError> {
|
||||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or(default)).init();
|
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or(default)).init();
|
||||||
|
|
||||||
let shutdown_token = tokio_util::sync::CancellationToken::new();
|
let shutdown_token = tokio_util::sync::CancellationToken::new();
|
||||||
let join_handle = tokio::spawn(desktop_run_async(args, shutdown_token.clone()));
|
let join_handle = tokio::spawn({
|
||||||
|
let shutdown_token = shutdown_token.clone();
|
||||||
|
async move {
|
||||||
|
if let Err(err) = desktop_run_async(args, shutdown_token).await {
|
||||||
|
log::error!("desktop_run_async error: {}", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ctrlc2::set_async_handler(async move {
|
ctrlc2::set_async_handler(async move {
|
||||||
log::info!("Ctrl-C received, exiting...");
|
log::info!("Ctrl-C received, exiting...");
|
||||||
|
|
Loading…
Add table
Reference in a new issue