diff options
| author | Matthieu <matthieu@developershouse.xyz> | 2021-09-05 00:14:30 +0400 |
|---|---|---|
| committer | Matthieu <matthieu@developershouse.xyz> | 2021-09-05 00:14:30 +0400 |
| commit | d4b704cf8948cee7d32319d59130f92095dbb351 (patch) | |
| tree | a45599d22d433ae8eda15fa696dde402bcff44ca /webhook/src/utils.rs | |
| parent | c98fb2ae14c3eef4130142eeff7aa4e8d3cea868 (diff) | |
| parent | ea06e615db5551ab558f4a3875107a3497ea2b48 (diff) | |
Merge branch 'webhook-receiver' of https://github.com/discordnova/nova into webhook-receiver
Diffstat (limited to 'webhook/src/utils.rs')
| -rw-r--r-- | webhook/src/utils.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/webhook/src/utils.rs b/webhook/src/utils.rs index 0a9a779..45c84fe 100644 --- a/webhook/src/utils.rs +++ b/webhook/src/utils.rs @@ -5,8 +5,8 @@ use log::info; use serde::Deserialize; /// Executes the required configuration steps for the program, -/// uncluding build information, Sentry and logging. -pub fn setup_program (_name: &str) { +/// excluding build information, Sentry and logging. +pub fn setup_program(_name: &str) { pretty_env_logger::init(); } @@ -22,7 +22,6 @@ pub struct Discord { pub client_id: u32, } - #[derive(Debug, Deserialize, Clone)] pub struct Settings { pub server: Server, @@ -35,15 +34,15 @@ impl Settings { default.merge(File::with_name("config/default"))?; let mode = env::var("ENV").unwrap_or_else(|_| "development".into()); info!("Configuration Environment: {}", mode); - + default.merge(File::with_name(&format!("config/{}", mode)).required(false))?; default.merge(File::with_name("config/local").required(false))?; default.merge(Environment::with_prefix("NOVA_GATEWAY"))?; - + println!("Debug mode: {:?}", default.get_bool("debug")); let config: Self = default.try_into().unwrap(); Ok(config) - } + } } |
