diff options
| author | Matthieu <matthieu@developershouse.xyz> | 2021-09-17 18:41:56 +0400 |
|---|---|---|
| committer | Matthieu <matthieu@developershouse.xyz> | 2021-09-17 18:41:56 +0400 |
| commit | 469a8fb1ea7b689399c30badbf33fc467531c561 (patch) | |
| tree | 8ea3caf86cc00c8c3b37287b6a7b1774bb5e8895 /common/rust/src/config.rs | |
| parent | ba0170ea15d6ebc1c9049f02adabd1ee4df6de64 (diff) | |
basic com implementation & cache base
Diffstat (limited to 'common/rust/src/config.rs')
| -rw-r--r-- | common/rust/src/config.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/rust/src/config.rs b/common/rust/src/config.rs index 6d8fb33..c158a21 100644 --- a/common/rust/src/config.rs +++ b/common/rust/src/config.rs @@ -11,6 +11,7 @@ pub struct Settings<T> { #[serde(skip_deserializing)] pub config: T, pub monitoring: crate::monitoring::MonitoringConfiguration, + pub nats: crate::nats::NatsConfiguration, } impl<T> Settings<T> where T: Deserialize<'static> + std::default::Default + Clone { @@ -25,14 +26,12 @@ impl<T> Settings<T> where T: Deserialize<'static> + std::default::Default + Clon default.merge(File::with_name("config/local").required(false))?; // we can configure each component using environment variables - default.merge(Environment::with_prefix(&format!("NOVA_{}", service_name)))?; + default.merge(Environment::with_prefix("NOVA").separator("_"))?; let mut config: Settings<T> = default.clone().try_into().unwrap(); // try to load the config config.config = default.get::<T>(&service_name).unwrap(); - - // setup the logger - pretty_env_logger::init_custom_env(&format!("NOVA_{}_LOG", service_name)); + pretty_env_logger::init(); // start the monitoring system if needed crate::monitoring::start_monitoring(&config.monitoring); |
