From d6ccd70d44823f4e79dd9b6edf5309bb66b396c5 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Mon, 6 Jan 2025 01:19:11 +0100 Subject: [PATCH] Log changes --- src/main.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4607238..d836aae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,12 +39,12 @@ async fn main() -> anyhow::Result<()> { . write_style_or("LOG_STYLE", "always"); env_logger::init_from_env(env); - log!(Level::Info, "-> Parse command line arguments..."); + log!(Level::Info, "Parse command line arguments..."); let args = Args::parse(); - log!(Level::Debug, "-> Arguments: {:?}", args); + log!(Level::Debug, "Arguments: {:?}", args); - log!(Level::Info, "-> Creating an HTTP client with Tower layers..."); + log!(Level::Info, "Creating an HTTP client with Tower layers..."); let concurrency = args.concurrency.unwrap_or(10); let timeout = args.timeout.unwrap_or(10); @@ -55,15 +55,15 @@ async fn main() -> anyhow::Result<()> { . ok_or(anyhow!("Problem path and query in m3u8 uri"))?; let mut state = client::State::new(&m3u8_uri, concurrency, timeout)?; - log!(Level::Info, "-> Get segments..."); + log!(Level::Info, "Get segments..."); let mut segments = state.get_m3u8_segment_uris(m3u8_path_and_query.as_str()).await?; - log!(Level::Info, "-> Sending concurrent requests..."); + log!(Level::Info, "Sending concurrent requests..."); let mut join_set = JoinSet::new(); while let Some(segment) = segments.pop() { - log!(Level::Info, " -> Spawn task for: {}", segment); + log!(Level::Info, "Spawn task for: {}", segment); let mut state = state.clone(); join_set.spawn(async move { state.get_m3u8_segment(&segment).await @@ -78,8 +78,7 @@ async fn main() -> anyhow::Result<()> { }, Ok(Err(e)) => { - log!(Level::Warn, "Retry failed download: {:?}", e); - log!(Level::Info, " -> Spawn task for: {}", e.uri); + log!(Level::Info, "Retry failed download: {:?}", e); let mut state = state.clone(); join_set.spawn(async move { state.get_m3u8_segment(&e.uri).await