diff options
author | Joris | 2024-06-02 12:53:20 +0200 |
---|---|---|
committer | Joris | 2024-06-02 12:53:20 +0200 |
commit | 0d5ec3626773edb7d32884c594230c7cc03ae0e7 (patch) | |
tree | 768b6d6fee0b5409c7a12f5aa7b191a25ca5f2d7 /src/main.rs | |
parent | 76a761630a8e6f5686d7e4384948ed949f702f3b (diff) |
Simplify logging initmain
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 5f3b8c6..2b3aebd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,9 +4,6 @@ use hyper_util::rt::TokioIo; use sqlx::sqlite::SqlitePool; use tokio::net::TcpListener; -#[macro_use] -extern crate log; - mod assets; mod controller; mod crypto; @@ -25,10 +22,8 @@ use model::config; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { - env_logger::Builder::from_env( - env_logger::Env::default().default_filter_or("warn"), - ) - .init(); + + env_logger::init(); let config = config::from_env() .unwrap_or_else(|err| panic!("Error reading config: {err}")); @@ -44,7 +39,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { tokio::spawn(jobs::start(config.clone(), pool.clone(), templates.clone())); let listener = TcpListener::bind(config.socket_address).await?; - info!("Starting server at {}", config.socket_address); + log::info!("Starting server at {}", config.socket_address); loop { let config = config.clone(); |