From 9b504d255e4cf06b75689852557beb920953b2f9 Mon Sep 17 00:00:00 2001 From: "Hatter Jiang@Pixelbook" Date: Thu, 8 Aug 2019 00:51:56 +0800 Subject: [PATCH] update verbose print --- Cargo.lock | 2 +- src/http.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d282616..dcdc1a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1094,7 +1094,7 @@ dependencies = [ [[package]] name = "rust_util" version = "0.1.0" -source = "git+https://github.com/jht5945/rust_util#f5fe205b78286f47a3af844c0691d703e96aacdd" +source = "git+https://github.com/jht5945/rust_util#5cae3115806ef87926cffdc814c5e5575070cc44" dependencies = [ "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/http.rs b/src/http.rs index dffcd2a..15d7fc6 100644 --- a/src/http.rs +++ b/src/http.rs @@ -16,7 +16,7 @@ use super::misc::*; pub fn download_url(url: &str, dest: &mut File) -> XResult<()> { let verbose = is_verbose(); if verbose { - print_message(MessageType::INFO, &format!("Download URL: {}", url)); + print_message(MessageType::DEBUG, &format!("Download URL: {}", url)); } let mut response = reqwest::get(url)?; let header_content_length: i64 = match response.headers().get("content-length") { @@ -24,7 +24,7 @@ pub fn download_url(url: &str, dest: &mut File) -> XResult<()> { Some(len_value) => len_value.to_str().unwrap().parse::().unwrap(), }; if verbose { - print_message(MessageType::INFO, &format!("Content-Length: {}", header_content_length)); + print_message(MessageType::DEBUG, &format!("Content-Length: {}", header_content_length)); } copy_io(&mut response, dest, header_content_length)?; Ok(()) @@ -32,7 +32,7 @@ pub fn download_url(url: &str, dest: &mut File) -> XResult<()> { pub fn get_url(url: &str) -> XResult { if is_verbose() { - print_message(MessageType::INFO, &format!("Get URL: {}", url)); + print_message(MessageType::DEBUG, &format!("Get URL: {}", url)); } Ok(reqwest::get(url)?.text()?) }