From d7062d1168813523d0173ba0544553466a583d7a Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 12 May 2020 22:24:08 +0200 Subject: [PATCH] reduce info logging --- ofborg/src/checkout.rs | 4 ++-- ofborg/src/clone.rs | 8 ++++---- ofborg/src/tasks/build.rs | 2 +- ofborg/src/tasks/eval/stdenvs.rs | 3 +-- ofborg/src/tasks/evaluate.rs | 10 ++++------ 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ofborg/src/checkout.rs b/ofborg/src/checkout.rs index 8e4109b..3814054 100644 --- a/ofborg/src/checkout.rs +++ b/ofborg/src/checkout.rs @@ -118,7 +118,7 @@ impl CachedProjectCo { pub fn commit_exists(&self, commit: &OsStr) -> bool { let mut lock = self.lock().expect("Failed to lock"); - info!("Checking if commit '{:?}' exists", commit); + info!("Checking if commit {:?} exists", commit); let result = Command::new("git") .arg("--no-pager") .arg("show") @@ -136,7 +136,7 @@ impl CachedProjectCo { pub fn merge_commit(&self, commit: &OsStr) -> Result<(), Error> { let mut lock = self.lock()?; - info!("Merging commit '{:?}'", commit); + info!("Merging commit {:?}", commit); let result = Command::new("git") .arg("merge") .arg("--no-gpg-sign") diff --git a/ofborg/src/clone.rs b/ofborg/src/clone.rs index 4b177ae..c143c26 100644 --- a/ofborg/src/clone.rs +++ b/ofborg/src/clone.rs @@ -26,7 +26,7 @@ pub trait GitClonable { fn lock_path(&self) -> PathBuf; fn lock(&self) -> Result { - info!("Locking {:?}", self.lock_path()); + debug!("Locking {:?}", self.lock_path()); match fs::File::create(self.lock_path()) { Err(e) => { @@ -111,7 +111,7 @@ pub trait GitClonable { fn clean(&self) -> Result<(), Error> { let mut lock = self.lock()?; - info!("git am --abort"); + debug!("git am --abort"); Command::new("git") .arg("am") .arg("--abort") @@ -120,7 +120,7 @@ pub trait GitClonable { .stderr(Stdio::null()) .status()?; - info!("git merge --abort"); + debug!("git merge --abort"); Command::new("git") .arg("merge") .arg("--abort") @@ -129,7 +129,7 @@ pub trait GitClonable { .stderr(Stdio::null()) .status()?; - info!("git reset --hard"); + debug!("git reset --hard"); Command::new("git") .arg("reset") .arg("--hard") diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 4ab29c1..e4f32bd 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -376,7 +376,7 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { info!("----->8-----"); actions.build_finished(status, can_build, cannot_build_attrs); - info!("Done!"); + info!("Build done!"); } } diff --git a/ofborg/src/tasks/eval/stdenvs.rs b/ofborg/src/tasks/eval/stdenvs.rs index 673f462..fc9327a 100644 --- a/ofborg/src/tasks/eval/stdenvs.rs +++ b/ofborg/src/tasks/eval/stdenvs.rs @@ -91,6 +91,7 @@ impl Stdenvs { /// This is used to find out what the output path of the stdenv for the /// given system. fn evalstdenv(&self, system: &str) -> Option { + info!(?system, "query stdenv output"); let result = self.nix.with_system(system.to_owned()).safely( &nix::Operation::QueryPackagesOutputs, &self.co, @@ -103,8 +104,6 @@ impl Stdenvs { true, ); - info!("{:?}", result); - match result { Ok(mut out) => Some(file_to_str(&mut out)), Err(mut out) => { diff --git a/ofborg/src/tasks/evaluate.rs b/ofborg/src/tasks/evaluate.rs index 2ee5bfa..31315cd 100644 --- a/ofborg/src/tasks/evaluate.rs +++ b/ofborg/src/tasks/evaluate.rs @@ -19,7 +19,7 @@ use std::time::Instant; use hubcaps::checks::CheckRunOptions; use hubcaps::gists::Gists; use hubcaps::issues::Issue; -use tracing::{debug_span, error, info, warn}; +use tracing::{debug, debug_span, error, info, warn}; pub struct EvaluationWorker { cloner: checkout::CachedCloner, @@ -441,8 +441,6 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> { send_check_statuses(complete.checks, &repo); response.extend(schedule_builds(complete.builds, auto_schedule_build_archs)); - info!("Just about done..."); - overall_status.set_with_description("^.^!", hubcaps::statuses::State::Success)?; } else { overall_status @@ -451,7 +449,7 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> { self.events.notify(Event::TaskEvaluationCheckComplete); - info!("done!"); + info!("Evaluations done!"); Ok(self.actions().done(&job, response)) } } @@ -459,8 +457,8 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> { fn send_check_statuses(checks: Vec, repo: &hubcaps::repositories::Repository) { for check in checks { match repo.checkruns().create(&check) { - Ok(_) => info!("Sent check update"), - Err(e) => info!("Failed to send check update: {:?}", e), + Ok(_) => debug!("Sent check update"), + Err(e) => warn!("Failed to send check update: {:?}", e), } } }