rust-lang / git2-rs

libgit2 bindings for Rust
https://docs.rs/git2
Apache License 2.0
1.68k stars 385 forks source link

How to use `git2::trace_set`? #865

Closed ArseniyZvezda closed 2 years ago

ArseniyZvezda commented 2 years ago

I would like to see the logs of my calls with git2 lib. I'm trying

git2::trace_set(TraceLevel::Debug, |_, res: &str| {
    println!("Git: {}", res)
})

and then something like Repository::open(...)

but console output still empty

extrawurst commented 2 years ago

checkout upstream libgit2. the actually calls that will create traces are sparse, AFAIK only code that talks to remotes is actually using it.