From 17ef61a126e81c9ecfd1ebdd89537e854a06cae6 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Wed, 13 Mar 2019 19:30:54 +0100 Subject: Switched to standard Rust logging system --- src/listing.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/listing.rs') diff --git a/src/listing.rs b/src/listing.rs index a9f0f19..b820aa4 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -7,7 +7,6 @@ use serde::Deserialize; use std::io; use std::path::Path; use std::time::SystemTime; -use yansi::Color; use crate::archive; use crate::errors; @@ -229,19 +228,14 @@ pub fn directory_listing( } if let Some(compression_method) = &download { - println!( - "{info} Creating an archive ({extension}) of {path}...", - info = Color::Blue.paint("info:").bold(), - extension = Color::White.paint(compression_method.extension()).bold(), - path = Color::White.paint(&dir.path.display().to_string()).bold() + log::info!( + "Creating an archive ({extension}) of {path}...", + extension = compression_method.extension(), + path = &dir.path.display().to_string() ); match archive::create_archive_file(&compression_method, &dir.path) { Ok((filename, content)) => { - println!( - "{success} {file} successfully created !", - success = Color::Green.paint("success:").bold(), - file = Color::White.paint(&filename).bold(), - ); + log::info!("{file} successfully created !", file = &filename); Ok(HttpResponse::Ok() .content_type(compression_method.content_type()) .content_length(content.len() as u64) -- cgit v1.2.3