diff rust/hg-cpython/src/dirstate/status.rs @ 44581:245aec57d76a

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
author Rapha?l Gom?s <rgomes@octobus.net>
date Wed, 18 Mar 2020 14:26:47 +0100
parents f96b28aa4b79
children e62052d0f377
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/status.rs	Wed Mar 18 15:08:14 2020 -0400
+++ b/rust/hg-cpython/src/dirstate/status.rs	Wed Mar 18 14:26:47 2020 +0100
@@ -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()),
     }