Skip to content
Snippets Groups Projects
Commit 245aec57d76a authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

rust-status: add trace-level logging for Rust status fallback for debugging

The added `log` crate is already a sub-dependency.

Differential Revision: https://phab.mercurial-scm.org/D8300
parent 6a8738dc4a01
No related merge requests found
......@@ -253,6 +253,7 @@
"cpython 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hg-core 0.1.0",
"libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"simple_logger 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
......
......@@ -24,6 +24,7 @@
[dependencies]
hg-core = { path = "../hg-core"}
libc = '*'
log = "0.4.8"
simple_logger = "1.6.0"
[dependencies.cpython]
......
......@@ -84,7 +84,10 @@
fn handle_fallback(py: Python, err: StatusError) -> PyErr {
match err {
StatusError::Pattern(e) => {
PyErr::new::<FallbackError, _>(py, e.to_string())
let as_string = e.to_string();
log::trace!("Rust status fallback: `{}`", &as_string);
PyErr::new::<FallbackError, _>(py, &as_string)
}
e => PyErr::new::<ValueError, _>(py, e.to_string()),
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment