From 97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 8 Sep 2024 23:59:39 +0200 Subject: add logging --- src/config.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 439c17c..13dd0e4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,6 @@ use config::{File, Map}; use serde::{Deserialize, Serialize}; +use tracing::{debug, trace}; #[derive(Debug, Serialize, Deserialize)] #[serde(default)] @@ -27,11 +28,15 @@ impl Default for Config { impl Config { pub fn load() -> Result { + debug!("load config"); let config = config::Config::builder() .add_source(File::with_name("config.toml").required(false)) .add_source(config::Environment::with_prefix("FXBAUP").separator("_")) .build()?; - config.try_deserialize() + let cfg = config.try_deserialize(); + trace!(?cfg, "loaded config"); + + cfg } } -- cgit v1.2.3