This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5e8e5c1  [config] Add debug log
5e8e5c1 is described below

commit 5e8e5c1ee092e0f2a1c0d59f9c6de7691faecf27
Author: Mingshen Sun <[email protected]>
AuthorDate: Tue Feb 18 20:22:22 2020 -0800

    [config] Add debug log
---
 config/Cargo.toml     | 1 +
 config/src/runtime.rs | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/config/Cargo.toml b/config/Cargo.toml
index 369bf98..f3825e3 100644
--- a/config/Cargo.toml
+++ b/config/Cargo.toml
@@ -12,6 +12,7 @@ mesalock_sgx = ["sgx_tstd"]
 
 [dependencies]
 anyhow = { version = "1.0.26" }
+log    = { version = "0.4.6" }
 serde  = { version = "1.0.92", features = ["derive"] }
 toml   = { version = "0.5.1" }
 
diff --git a/config/src/runtime.rs b/config/src/runtime.rs
index f410f8c..8d45808 100644
--- a/config/src/runtime.rs
+++ b/config/src/runtime.rs
@@ -69,7 +69,7 @@ pub struct AttestationServiceConfig {
 
 impl RuntimeConfig {
     pub fn from_toml<T: AsRef<Path>>(path: T) -> Result<Self> {
-        let contents = fs::read_to_string(path)
+        let contents = fs::read_to_string(path.as_ref())
             .context("Something went wrong when reading the runtime config 
file")?;
         let mut config: RuntimeConfig =
             toml::from_str(&contents).context("Cannot parse the runtime config 
file")?;
@@ -112,6 +112,11 @@ impl RuntimeConfig {
 
         validate_config(&config)?;
 
+        log::debug!(
+            "Loaded config from {}: {:?}",
+            path.as_ref().display(),
+            config
+        );
         Ok(config)
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to