diff rust/hg-cpython/src/dirstate.rs @ 44540:82f51ab7a2dd

rust: add logging utils This change adds the `log` crate, the community-approved logging facade backed by Rust core developers as well as the logging-consumer crate `simple_logger` to build a foundation for logging from Rust. Using this setup allows us to choose how to log depending on the way `hg-core` is used: if it's within the context of `hg-cpython`, we might not want to use it the same way as with a direct cli for example. Differential Revision: https://phab.mercurial-scm.org/D8252
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 06 Mar 2020 18:08:13 +0100
parents f96b28aa4b79
children 01afda7e7d6c
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate.rs	Fri Mar 06 17:51:24 2020 +0100
+++ b/rust/hg-cpython/src/dirstate.rs	Fri Mar 06 18:08:13 2020 +0100
@@ -107,6 +107,8 @@
     let dotted_name = &format!("{}.dirstate", package);
     let m = PyModule::new(py, dotted_name)?;
 
+    simple_logger::init_by_env();
+
     m.add(py, "__package__", package)?;
     m.add(py, "__doc__", "Dirstate - Rust implementation")?;