1
0
mirror of https://github.com/actix/actix-website synced 2025-01-23 00:25:55 +01:00

Use RUST_LOG env var if set (#163)

* Use RUST_LOG env var if set

* Remove redundant use statement
This commit is contained in:
Stig Johan Berggren 2020-03-02 22:53:39 +01:00 committed by GitHub
parent a784af8010
commit 0b9a56aa2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,12 @@
// <logger> // <logger>
use actix_web::middleware::Logger; use actix_web::middleware::Logger;
use env_logger; use env_logger::Env;
#[actix_rt::main] #[actix_rt::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
use actix_web::{App, HttpServer}; use actix_web::{App, HttpServer};
std::env::set_var("RUST_LOG", "actix_web=info"); env_logger::from_env(Env::default().default_filter_or("info")).init();
env_logger::init();
HttpServer::new(|| { HttpServer::new(|| {
App::new() App::new()