From 2c7a3fb5cc153ff0b8b5e79234ae497d916e471c Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 29 Jul 2024 18:06:35 +0200 Subject: [PATCH] fix: cli: print video ID when logging errors --- cli/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index cd5c6fe..5011a13 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -334,7 +334,7 @@ async fn download_video( } let res = q.download().await; if let Err(e) = res { - tracing::error!("{e}") + tracing::error!("[{id}]: {e}") } } @@ -379,6 +379,7 @@ async fn download_videos( .for_each_concurrent(parallel, |video| { let dl = dl.clone(); let main = main.clone(); + let id = &video.id; let mut q = target.apply(dl.download_entity(video)); if let Some(player_type) = player_type { @@ -387,7 +388,7 @@ async fn download_videos( async move { if let Err(e) = q.download().await { - tracing::error!("{e:?}"); + tracing::error!("[{id}]: {e}"); } else { main.inc(1); }