diff --git a/Cargo.toml b/Cargo.toml index 1eaa475..5f20f8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "twba-splitter" -version = "0.1.2" +version = "0.1.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/client.rs b/src/client.rs index b734570..c0b9dfc 100644 --- a/src/client.rs +++ b/src/client.rs @@ -26,7 +26,7 @@ impl SplitterClient { } impl SplitterClient { - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self, video), fields(video_id = video.id))] async fn split_video(&self, video: VideosModel) -> Result<()> { // let id = video.id.to_string(); diff --git a/src/client/utils.rs b/src/client/utils.rs index 7c2cd55..404f53f 100644 --- a/src/client/utils.rs +++ b/src/client/utils.rs @@ -5,6 +5,7 @@ use anyhow::Context; use chrono::Duration; use std::path::{Path, PathBuf}; use tokio::process::Command; +use tracing::instrument; /// Converts a duration to a string that is usable for example in an ffmpeg command /// @@ -24,7 +25,7 @@ pub fn duration_to_string(duration: &Duration) -> String { let seconds = seconds % 60; format!("{:02}:{:02}:{:02}", hours, minutes, seconds) } - +#[instrument(skip(input_parts), fields(input_parts_amount = input_parts.parts.len(), total_duration = input_parts.total_duration.num_seconds()))] pub(super) async fn join_last_parts_if_needed( mut input_parts: PlaylistInfo, base_folder: &Path, diff --git a/src/client/utils/ffmpeg.rs b/src/client/utils/ffmpeg.rs index 96aa669..95e5ab5 100644 --- a/src/client/utils/ffmpeg.rs +++ b/src/client/utils/ffmpeg.rs @@ -1,5 +1,6 @@ use super::*; - +use tracing::instrument; +#[instrument(skip(join_txt_path, join_out_path))] pub(crate) async fn run_ffmpeg_concat( join_txt_path: impl Into, join_out_path: impl Into, @@ -29,7 +30,7 @@ pub(crate) async fn run_ffmpeg_concat( debug!("Finished running ffmpeg command"); Ok(()) } - +#[instrument(skip(input, target_duration, output_playlist, output_pattern))] pub(crate) async fn run_ffmpeg_split( input: &Path, output_pattern: &String,