From 3467038353df17f962903f97552c01315e5979ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sat, 21 May 2022 09:07:37 +0300 Subject: [PATCH] feat(env): support configuring logger from .env file --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 705beae..025ec8f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,11 +18,13 @@ use std::time::Duration; #[actix_web::main] async fn main() -> IoResult<()> { + // Load the .env file. + dotenv::dotenv().ok(); + // Initialize logger. env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); // Parse configuration. - dotenv::dotenv().ok(); let config_path = match env::var(CONFIG_ENV).ok() { Some(path) => { env::remove_var(CONFIG_ENV);