diff --git a/asyncgit/src/diff.rs b/asyncgit/src/diff.rs index ad0d337d..7dbea7f3 100644 --- a/asyncgit/src/diff.rs +++ b/asyncgit/src/diff.rs @@ -2,7 +2,6 @@ use crate::{ error::Result, hash, sync, AsyncNotification, FileDiff, CWD, }; use crossbeam_channel::Sender; -use log::trace; use std::{ hash::Hash, sync::{ @@ -72,7 +71,7 @@ impl AsyncDiff { &mut self, params: DiffParams, ) -> Result> { - trace!("request"); + log::trace!("request"); let hash = hash(¶ms); diff --git a/asyncgit/src/revlog.rs b/asyncgit/src/revlog.rs index 38d0c110..a4029751 100644 --- a/asyncgit/src/revlog.rs +++ b/asyncgit/src/revlog.rs @@ -5,7 +5,6 @@ use crate::{ }; use crossbeam_channel::Sender; use git2::Oid; -use log::debug; use scopetime::scope_time; use std::{ iter::FromIterator, @@ -89,11 +88,6 @@ impl AsyncLog { fn head_changed(&self) -> Result { if let Ok(head) = repo(CWD)?.head() { if let Some(head) = head.target() { - debug!( - "repo head vs current log head: {} vs. {}", - head, - self.current_head()? - ); return Ok(head != self.current_head()?); } } diff --git a/asyncgit/src/status.rs b/asyncgit/src/status.rs index 1b791855..5a73b9dc 100644 --- a/asyncgit/src/status.rs +++ b/asyncgit/src/status.rs @@ -2,7 +2,6 @@ use crate::{ error::Result, hash, sync, AsyncNotification, StatusItem, CWD, }; use crossbeam_channel::Sender; -use log::trace; use std::{ hash::Hash, sync::{ @@ -86,7 +85,7 @@ impl AsyncStatus { ) -> Result> { let hash_request = hash(¶ms); - trace!("request: [hash: {}]", hash_request); + log::trace!("request: [hash: {}]", hash_request); { let mut current = self.current.lock()?; @@ -135,7 +134,7 @@ impl AsyncStatus { arc_last: Arc>, ) -> Result<()> { let res = Self::get_status(status_type, include_untracked)?; - trace!("status fetched: {}", hash(&res)); + log::trace!("status fetched: {}", hash(&res)); { let mut current = arc_current.lock()?; diff --git a/asyncgit/src/sync/hunks.rs b/asyncgit/src/sync/hunks.rs index 00155b15..8fb9af47 100644 --- a/asyncgit/src/sync/hunks.rs +++ b/asyncgit/src/sync/hunks.rs @@ -4,7 +4,6 @@ use super::{ }; use crate::{error::Error, error::Result, hash}; use git2::{ApplyLocation, ApplyOptions, Diff}; -use log::error; use scopetime::scope_time; /// @@ -72,7 +71,6 @@ pub fn unstage_hunk( let hunk_index = find_hunk_index(&diff, hunk_hash); if hunk_index.is_none() { - error!("hunk not found"); return Err(Error::Generic("hunk not found".to_string())); } @@ -100,7 +98,6 @@ pub fn unstage_hunk( .apply(&diff, ApplyLocation::Index, Some(&mut opt)) .is_err() { - error!("apply failed"); return Err(Error::Generic("apply failed".to_string())); } } diff --git a/scopetime/src/lib.rs b/scopetime/src/lib.rs index 58478d07..649d2c59 100644 --- a/scopetime/src/lib.rs +++ b/scopetime/src/lib.rs @@ -4,7 +4,6 @@ #![forbid(missing_docs)] #![deny(clippy::result_unwrap_used)] -use log::trace; use std::time::Instant; /// @@ -37,7 +36,7 @@ impl<'a> ScopeTimeLog<'a> { impl<'a> Drop for ScopeTimeLog<'a> { fn drop(&mut self) { - trace!( + log::trace!( "scopetime: {:?} ms [{}::{}] @{}:{}", self.time.elapsed().as_millis(), self.mod_path, diff --git a/src/app.rs b/src/app.rs index 279aa66e..af740666 100644 --- a/src/app.rs +++ b/src/app.rs @@ -16,7 +16,6 @@ use asyncgit::{sync, AsyncNotification, CWD}; use crossbeam_channel::Sender; use crossterm::event::Event; use itertools::Itertools; -use log::trace; use std::borrow::Cow; use strings::commands; use tui::{ @@ -113,7 +112,7 @@ impl App { /// pub fn event(&mut self, ev: Event) -> Result<()> { - trace!("event: {:?}", ev); + log::trace!("event: {:?}", ev); if self.check_quit(ev) { return Ok(()); @@ -155,7 +154,7 @@ impl App { //TODO: do we need this? /// forward ticking to components that require it pub fn update(&mut self) -> Result<()> { - trace!("update"); + log::trace!("update"); self.status_tab.update()?; self.revlog.update()?; self.stashing_tab.update()?; @@ -168,7 +167,7 @@ impl App { &mut self, ev: AsyncNotification, ) -> Result<()> { - trace!("update_git: {:?}", ev); + log::trace!("update_git: {:?}", ev); self.status_tab.update_git(ev)?; self.stashing_tab.update_git(ev)?; diff --git a/src/components/commit.rs b/src/components/commit.rs index 5019dfd9..6107a2df 100644 --- a/src/components/commit.rs +++ b/src/components/commit.rs @@ -10,7 +10,6 @@ use crate::{ use anyhow::Result; use asyncgit::{sync, CWD}; use crossterm::event::{Event, KeyCode}; -use log::error; use strings::commands; use sync::HookResult; use tui::{backend::Backend, layout::Rect, Frame}; @@ -104,7 +103,7 @@ impl CommitComponent { if let HookResult::NotOk(e) = sync::hooks_commit_msg(CWD, &mut msg)? { - error!("commit-msg hook error: {}", e); + log::error!("commit-msg hook error: {}", e); self.queue.borrow_mut().push_back( InternalEvent::ShowErrorMsg(format!( "commit-msg hook error:\n{}", @@ -115,7 +114,7 @@ impl CommitComponent { } if let Err(e) = sync::commit(CWD, &msg) { - error!("commit error: {}", &e); + log::error!("commit error: {}", &e); self.queue.borrow_mut().push_back( InternalEvent::ShowErrorMsg(format!( "commit failed:\n{}", @@ -126,7 +125,7 @@ impl CommitComponent { } if let HookResult::NotOk(e) = sync::hooks_post_commit(CWD)? { - error!("post-commit hook error: {}", e); + log::error!("post-commit hook error: {}", e); self.queue.borrow_mut().push_back( InternalEvent::ShowErrorMsg(format!( "post-commit hook error:\n{}",