From fc011855f6f0094bd1f5b20a5b42ea85e39aed4b Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 7 Oct 2020 06:33:32 +0100 Subject: [PATCH] better log levels --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/ext.rs | 1 + src/parallel.rs | 4 ++-- src/serial.rs | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83f6057..04362f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,7 +619,7 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sever" -version = "1.1.0" +version = "1.1.1" dependencies = [ "cfg-if", "color-eyre", diff --git a/Cargo.toml b/Cargo.toml index c01a734..959ba1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sever" description = "Coerce hardlinks into new files" -version = "1.1.0" +version = "1.1.1" authors = ["Avril "] edition = "2018" readme = "README.org" diff --git a/src/ext.rs b/src/ext.rs index 0a0cd43..d2e8041 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -79,4 +79,5 @@ mod para } } +#[cfg(feature="parallel")] pub use para::*; diff --git a/src/parallel.rs b/src/parallel.rs index 437084f..29b6ca3 100644 --- a/src/parallel.rs +++ b/src/parallel.rs @@ -84,7 +84,7 @@ async fn work>(apath: P, sem: Option>) -> Result<( use std::os::unix::fs::MetadataExt; let nlink = meta.nlink(); - debug!("<{:?}> has {} links", path, nlink); + trace!("<{:?}> has {} links", path, nlink); if nlink > 1 { //todo work i guess fuck it unlink(path).await?; @@ -115,7 +115,7 @@ pub async fn main>(list: I) -> eyre::Result<()> { match res { Ok(Ok((path, true))) => info!("<{:?}> OK (processed)", path), - Ok(Ok((path, false))) => info!("<{:?}> OK (skipped)", path), + Ok(Ok((path, false))) => debug!("<{:?}> OK (skipped)", path), Err(e) => { trace!("child {} cancelled by {}", i, if e.is_panic(){"panic"} else {"cancel"}); if e.is_panic() { diff --git a/src/serial.rs b/src/serial.rs index 0dfa80d..ba2ed95 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -42,7 +42,7 @@ fn work>(apath: P) -> Result<(P, bool), Error> use std::os::unix::fs::MetadataExt; let nlink = meta.nlink(); - debug!("<{:?}> has {} links", path, nlink); + trace!("<{:?}> has {} links", path, nlink); if nlink > 1 { unlink(path)?; Ok((apath, true)) @@ -63,7 +63,7 @@ pub fn main>(list: I) -> eyre::Result<()> { match work(file) { Ok((path, true)) => info!("<{:?}> OK (processed)", path), - Ok((path, false)) => info!("<{:?}> OK (skipped)", path), + Ok((path, false)) => debug!("<{:?}> OK (skipped)", path), Err(kind) if !kind.kind().is_skippable() => { failures.push((kind.path().to_owned(), kind.to_string())); let fuck = format!("{:?}", kind.path());