diff options
author | fxqnlr <[email protected]> | 2024-09-08 23:59:39 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-08 23:59:39 +0200 |
commit | 97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7 (patch) | |
tree | 5a7840bb1905bd84ba95cca11b74762fd028f3d0 /src/config.rs | |
parent | 9a34651063029394845a3e18fe7afd5b7c4db777 (diff) | |
download | arbs-97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7.tar arbs-97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7.tar.gz arbs-97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7.zip |
add logging
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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 @@ | |||
1 | use config::{File, Map}; | 1 | use config::{File, Map}; |
2 | use serde::{Deserialize, Serialize}; | 2 | use serde::{Deserialize, Serialize}; |
3 | use tracing::{debug, trace}; | ||
3 | 4 | ||
4 | #[derive(Debug, Serialize, Deserialize)] | 5 | #[derive(Debug, Serialize, Deserialize)] |
5 | #[serde(default)] | 6 | #[serde(default)] |
@@ -27,11 +28,15 @@ impl Default for Config { | |||
27 | 28 | ||
28 | impl Config { | 29 | impl Config { |
29 | pub fn load() -> Result<Self, config::ConfigError> { | 30 | pub fn load() -> Result<Self, config::ConfigError> { |
31 | debug!("load config"); | ||
30 | let config = config::Config::builder() | 32 | let config = config::Config::builder() |
31 | .add_source(File::with_name("config.toml").required(false)) | 33 | .add_source(File::with_name("config.toml").required(false)) |
32 | .add_source(config::Environment::with_prefix("FXBAUP").separator("_")) | 34 | .add_source(config::Environment::with_prefix("FXBAUP").separator("_")) |
33 | .build()?; | 35 | .build()?; |
34 | 36 | ||
35 | config.try_deserialize() | 37 | let cfg = config.try_deserialize(); |
38 | trace!(?cfg, "loaded config"); | ||
39 | |||
40 | cfg | ||
36 | } | 41 | } |
37 | } | 42 | } |