From ab18a09d763b07912b617d6b9d18e0abe4bc4663 Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Sat, 15 Jul 2023 12:59:16 +0200 Subject: [PATCH] some logging changes --- src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7f8d58e..d7964db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -256,23 +256,30 @@ async fn backup_not_downloaded_videos<'a>( } let mut video = video.unwrap(); - trace!("Creating youtube client"); + trace!("Getting youtube client"); let youtube_client = youtube_clients.get( video .streamer .youtube_user .as_ref() - .unwrap_or(&"NopixelVODs".to_string()), + .unwrap_or(&"unknown".to_string()), ); if youtube_client.is_none() { warn!("could not find youtube client for video: {:?}", video); + let clients: Vec = youtube_clients.keys().map(|k| k.clone()).collect(); + let clients: String = clients.join(";"); + warn!( + ?video, + warning = "could not find youtube client for video", + clients + ); continue; } let youtube_client = youtube_client.expect("we just checked it"); let result = backup_video(twitch_client, config, path, &mut video, &youtube_client).await; if let Err(e) = result { let error_message = format!("Error while backing up video: {}", e.to_string()); - warn!("{}", error_message); + warn!(error_message, error=?e); video.metadata.error = Some(error_message); video.metadata.backed_up = Some(false); video.metadata.save().await.map_err(|e| anyhow!("{}", e))?;