better log levels

master
Avril 4 years ago
parent 5b1ce2869b
commit fc011855f6
Signed by: flanchan
GPG Key ID: 284488987C31F630

2
Cargo.lock generated

@ -619,7 +619,7 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]] [[package]]
name = "sever" name = "sever"
version = "1.1.0" version = "1.1.1"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"color-eyre", "color-eyre",

@ -1,7 +1,7 @@
[package] [package]
name = "sever" name = "sever"
description = "Coerce hardlinks into new files" description = "Coerce hardlinks into new files"
version = "1.1.0" version = "1.1.1"
authors = ["Avril <flanchan@cumallover.me>"] authors = ["Avril <flanchan@cumallover.me>"]
edition = "2018" edition = "2018"
readme = "README.org" readme = "README.org"

@ -79,4 +79,5 @@ mod para
} }
} }
#[cfg(feature="parallel")]
pub use para::*; pub use para::*;

@ -84,7 +84,7 @@ async fn work<P: AsRef<Path>>(apath: P, sem: Option<Arc<Semaphore>>) -> Result<(
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
let nlink = meta.nlink(); let nlink = meta.nlink();
debug!("<{:?}> has {} links", path, nlink); trace!("<{:?}> has {} links", path, nlink);
if nlink > 1 { if nlink > 1 {
//todo work i guess fuck it //todo work i guess fuck it
unlink(path).await?; unlink(path).await?;
@ -115,7 +115,7 @@ pub async fn main<I: Stream<Item=String>>(list: I) -> eyre::Result<()>
{ {
match res { match res {
Ok(Ok((path, true))) => info!("<{:?}> OK (processed)", path), 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) => { Err(e) => {
trace!("child {} cancelled by {}", i, if e.is_panic(){"panic"} else {"cancel"}); trace!("child {} cancelled by {}", i, if e.is_panic(){"panic"} else {"cancel"});
if e.is_panic() { if e.is_panic() {

@ -42,7 +42,7 @@ fn work<P: AsRef<Path>>(apath: P) -> Result<(P, bool), Error>
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
let nlink = meta.nlink(); let nlink = meta.nlink();
debug!("<{:?}> has {} links", path, nlink); trace!("<{:?}> has {} links", path, nlink);
if nlink > 1 { if nlink > 1 {
unlink(path)?; unlink(path)?;
Ok((apath, true)) Ok((apath, true))
@ -63,7 +63,7 @@ pub fn main<I: IntoIterator<Item=String>>(list: I) -> eyre::Result<()>
{ {
match work(file) { match work(file) {
Ok((path, true)) => info!("<{:?}> OK (processed)", path), 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() => { Err(kind) if !kind.kind().is_skippable() => {
failures.push((kind.path().to_owned(), kind.to_string())); failures.push((kind.path().to_owned(), kind.to_string()));
let fuck = format!("{:?}", kind.path()); let fuck = format!("{:?}", kind.path());

Loading…
Cancel
Save