fix: set logging env var if unset

This commit is contained in:
Aravinth Manivannan 2022-03-29 19:15:55 +05:30
parent fc8f86a2af
commit 55b7bf92bb
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88

View file

@ -47,7 +47,12 @@ pub const PKG_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE");
#[cfg(not(tarpaulin_include))] #[cfg(not(tarpaulin_include))]
#[actix_web::main] #[actix_web::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
{
const LOG_VAR: &str = "RUST_LOG";
if env::var(LOG_VAR).is_err() {
env::set_var("RUST_LOG", "info"); env::set_var("RUST_LOG", "info");
}
}
pretty_env_logger::init(); pretty_env_logger::init();