Skip to content

Commit 3467038

Browse files
committed
feat(env): support configuring logger from .env file
1 parent 63c79b8 commit 3467038

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ use std::time::Duration;
1818

1919
#[actix_web::main]
2020
async fn main() -> IoResult<()> {
21+
// Load the .env file.
22+
dotenv::dotenv().ok();
23+
2124
// Initialize logger.
2225
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
2326

2427
// Parse configuration.
25-
dotenv::dotenv().ok();
2628
let config_path = match env::var(CONFIG_ENV).ok() {
2729
Some(path) => {
2830
env::remove_var(CONFIG_ENV);

0 commit comments

Comments
 (0)