mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
hook into libgit2 tracing (#822)
This commit is contained in:
parent
71b398e858
commit
e16dfcaee7
3 changed files with 13 additions and 2 deletions
|
|
@ -14,10 +14,10 @@ keywords = ["git"]
|
|||
[dependencies]
|
||||
scopetime = { path = "../scopetime", version = "0.1" }
|
||||
git2 = "0.13"
|
||||
# git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]}
|
||||
# git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]}
|
||||
# pinning to vendored openssl, using the git2 feature this gets lost with new resolver
|
||||
openssl-sys = { version = '0.9', features= ["vendored"] }
|
||||
# git2 = { path = "../../github/git2-rs", features = ["vendored-openssl"]}
|
||||
# git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="513a8c9", features = ["vendored-openssl"]}
|
||||
rayon-core = "1.9"
|
||||
crossbeam-channel = "0.5"
|
||||
log = "0.4"
|
||||
|
|
|
|||
|
|
@ -94,3 +94,12 @@ pub fn hash<T: Hash + ?Sized>(v: &T) -> u64 {
|
|||
v.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
|
||||
///
|
||||
pub fn register_tracing_logging() -> bool {
|
||||
git2::trace_set(git2::TraceLevel::Trace, git_trace)
|
||||
}
|
||||
|
||||
fn git_trace(level: git2::TraceLevel, msg: &str) {
|
||||
log::info!("[{:?}]: {}", level, msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ fn main() -> Result<()> {
|
|||
|
||||
let _profiler = Profiler::new();
|
||||
|
||||
asyncgit::register_tracing_logging();
|
||||
|
||||
if !valid_path()? {
|
||||
eprintln!("invalid path\nplease run gitui inside of a non-bare git repository");
|
||||
return Ok(());
|
||||
|
|
|
|||
Loading…
Reference in a new issue