mirror of
https://github.com/amigan/rustypaste-pretty.git
synced 2024-12-03 09:46:47 -05:00
feat(env): support configuring logger from .env file
This commit is contained in:
parent
63c79b8297
commit
3467038353
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue