From e58acf828c269265fcc67a1754e208aa07390436 Mon Sep 17 00:00:00 2001 From: Jan Lukas Gernert Date: Mon, 27 Jan 2020 01:48:54 +0100 Subject: [PATCH] improve logging clearity --- src/lib.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 01bf271..ce2f523 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,7 @@ impl ArticleScraper { url: url::Url, download_images: bool, ) -> Result { - info!("Scraping article: {}", url.as_str()); + info!("Scraping article: '{}'", url.as_str()); let response = self .client .head(url.clone()) @@ -69,7 +69,7 @@ impl ArticleScraper { .await .map_err(|err| { error!( - "Failed head request to: {} - {}", + "Failed head request to: '{}' - '{}'", url.as_str(), err.description() ); @@ -80,7 +80,7 @@ impl ArticleScraper { // check if url redirects and we need to pick up the new url let mut url = url; if let Some(new_url) = ArticleScraper::check_redirect(&response) { - debug!("Url {} redirects to {}", url.as_str(), new_url.as_str()); + debug!("Url '{}' redirects to '{}'", url.as_str(), new_url.as_str()); url = new_url; } @@ -117,12 +117,12 @@ impl ArticleScraper { })?; if let Err(error) = ArticleScraper::prevent_self_closing_tags(&context) { - error!("Preventing self closing tags failed - {}", error); + error!("Preventing self closing tags failed - '{}'", error); return Err(error); } if let Err(error) = ArticleScraper::eliminate_noscrip_tag(&context) { - error!("Eliminating