Skip to content

Commit

Permalink
Load env logger after dot env
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Feb 5, 2024
1 parent e968020 commit 533c26b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const MAX_SEND_AMOUNT: u64 = 10_000_000;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
pretty_env_logger::try_init()?;
let state = setup().await;

let app = Router::new()
Expand Down
2 changes: 2 additions & 0 deletions src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ pub async fn setup() -> AppState {
dotenv::from_filename(".env.local").ok();
dotenv::from_filename(".env").ok();
dotenv::dotenv().ok();
// log env logger after dotenv
pretty_env_logger::try_init()?;

let host = env::var("HOST").expect("missing HOST");

Expand Down

0 comments on commit 533c26b

Please sign in to comment.